Skip to content

Instantly share code, notes, and snippets.

@brentley
Forked from rothgar/streamyard-tampermonkey.js
Created August 10, 2020 23:42
Show Gist options
  • Save brentley/97395a8f0e3e7befde4b3d69addb2b98 to your computer and use it in GitHub Desktop.
Save brentley/97395a8f0e3e7befde4b3d69addb2b98 to your computer and use it in GitHub Desktop.
Streamyard Keyboard Shortcuts
// ==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