-
-
Save brentley/97395a8f0e3e7befde4b3d69addb2b98 to your computer and use it in GitHub Desktop.
Streamyard Keyboard Shortcuts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment