-
-
Save rothgar/92e69d5bdcf80ea23f065bb6db03f7cd to your computer and use it in GitHub Desktop.
| // ==UserScript== | |
| // @name Streamyard Keyboard Shortcuts | |
| // @namespace http://streamyard.com | |
| // @version 0.1 | |
| // @description Simple keyboard shortcuts for streamyard | |
| // @author [email protected] | |
| // @match https://streamyard.com/* | |
| // @grant none | |
| // @run-at document-end | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| document.addEventListener('keydown', function(e) { | |
| //console.log(e); | |
| if (e.key == "m" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { | |
| var unmuteButton = document.querySelector('[aria-label="Unmute microphone"]'); | |
| var muteButton = document.querySelector('[aria-label="Mute microphone"]'); | |
| if (unmuteButton !== null) { | |
| unmuteButton.click(); | |
| } else { | |
| muteButton.click(); | |
| } | |
| } else if (e.key == "v" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { | |
| var faceUnmuteButton = document.querySelector('[aria-label="turn on camera"]'); | |
| var faceMuteButton = document.querySelector('[aria-label="turn off camera"]'); | |
| if (faceUnmuteButton !== null) { | |
| faceUnmuteButton.click(); | |
| } else { | |
| faceMuteButton.click(); | |
| } | |
| } | |
| }, false); | |
| })(); |
I'm loading the script with tampermonkey https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
It works but has some bugs I haven't had time to fix yet. Would welcome any feedback/updates to make it more stable.
Specifically I need to detect when the keyboard isn't focused on an input field (chat window)
I'm interested in this, can I make it work with my Elgato Stream Deck?
I'm interested in this, can I make it work with my Elgato Stream Deck?
I was able to use a Stream Deck with this no problem, simply simulate the keyboard presses in the software and have Streamyard open with this script and it works. I was also able to modify this to simulate a few other shots like the various layouts since they all had unique aria text. Thanks @rothgar!
Could scripts like these be used with Tampermonkey to execute cusotm multi-action macros in Streamyard?
For example, I would love to be able to program a key on the Elgato Stream Deck to put a png or GIF overlay onto the stream for a specified amount of time and then take it down, for example Like or Subscribe images or animations for 3-5 seconds.
If yes, and someone would be interested in putting some code together (for remuneration) please reach out [yisroel @ rabbiglick.com].
Hi @rothgar is this a script you can add to a live Streamyard session?
If yes, I tried to add it editing vie google chrome developer tools and adding in the
<head>section something like:But after typing
mthe mute action didn't trigger. any clue on what's went wrong?