Skip to content

Instantly share code, notes, and snippets.

@dewski
Created June 10, 2013 22:05
Show Gist options
  • Save dewski/5752818 to your computer and use it in GitHub Desktop.
Save dewski/5752818 to your computer and use it in GitHub Desktop.
var pauseId;
// What the existing players c
window.permitMainAudio = function(event) {
if (!player.isPlaying()) {
return true;
}
// event.location is info from source, ie YouTube
if (event.source == 'video') {
player.pause();
pauseId = event.requestId;
return true;
}
return false;
}
window.releaseMainAudio = function(event) {
if (event.requestId == pauseId) {
player.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment