Skip to content

Instantly share code, notes, and snippets.

@nilovelez
Forked from rothgar/streamyard-tampermonkey.js
Last active April 12, 2021 18:40
Show Gist options
  • Save nilovelez/671b82d302f2f291e48d16b9c8121d14 to your computer and use it in GitHub Desktop.
Save nilovelez/671b82d302f2f291e48d16b9c8121d14 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 justinleegarrison@gmail.com
// @match https://streamyard.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
document.addEventListener('keydown', function(e) {
console.log(e.key);
/*
if (e.key == "F13" && !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 == "F14" && !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();
}
}
*/
if (e.key == "F13" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var groupButton = document.querySelector('[aria-label="Group layout. All cameras are visible and spaced out."]');
if (groupButton !== null) {
groupButton.click();
}
} else if (e.key == "F14" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var smallButton = document.querySelector('[aria-label="Small screen layout. One camera and the shared screen are visible. If no screen, it behaves like the leader layout."]');
if (smallButton !== null) {
smallButton.click();
}
} else if (e.key == "F15" && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
var largeButton = document.querySelector('[aria-label="Large screen layout. The shared screen is large, all cameras are visible but small. If no screen, it behaves like the group layout."]');
if (largeButton !== null) {
largeButton.click();
}
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment