Skip to content

Instantly share code, notes, and snippets.

@nisrulz
Forked from caseywatts/0 push to talk.md
Created March 22, 2020 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nisrulz/447b9ebc2c266fe0797378598a83c9b3 to your computer and use it in GitHub Desktop.
Save nisrulz/447b9ebc2c266fe0797378598a83c9b3 to your computer and use it in GitHub Desktop.
Push To Talk - Google Meet Bookmarklet

Short link to this page: http://caseywatts.com/ptt

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Push To Talk in a Google Hangout (Meet)

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
    • Name: PTT (push to talk) or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
    • URL: (paste in the bookmarklet.js contents below)
  2. In a Meet, click on the bookmarklet
  3. Press and hold spacebar to talk. Keydown will un-mute you, and keyup will re-mute you.
  4. 🎉
javascript: (() => {
const toggle = tip => ({ key }) =>
key === ' ' && document.querySelectorAll('[data-tooltip]').forEach(el => el.dataset.tooltip === tip && el.click());
document.body.onkeyup = toggle('Turn off microphone');
document.body.onkeydown = toggle('Turn on microphone');
})(); // fixed by @sparksm
javascript:(function(){
document.body.onkeyup = function(e){
if(e.keyCode == 32){
document.querySelector('[data-tooltip="Turn off microphone"]').click(); // Meet
// document.querySelector('[data-tooltip="Mute microphone"]').click(); // Hangouts, but it doesn't work
}
};
document.body.onkeydown = function(e){
if(e.keyCode == 32){
document.querySelector('[data-tooltip="Turn on microphone"]').click(); // Meet
// document.querySelector('[data-tooltip="Unmute microphone"]').click(); // Hangouts, but it doesn't work
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment