Skip to content

Instantly share code, notes, and snippets.

@jamesmundy
Created January 12, 2019 21:04
Show Gist options
  • Save jamesmundy/2029eab33cbc4868a66d7bcfaba8abde to your computer and use it in GitHub Desktop.
Save jamesmundy/2029eab33cbc4868a66d7bcfaba8abde to your computer and use it in GitHub Desktop.
function playSoundAtPoint(video, currentSecond, secondToPlay, trackNumber, listen, pauseVideo) {
if (currentSecond >= secondToPlay) {
if (pauseVideo === true) {
video.pause();
}
playTrack(trackNumber, listen);
return true;
}
}
function beginListeningAtPoint(video, currentSecond, secondToPlay, pauseVideo) {
if (currentSecond >= secondToPlay) {
if (pauseVideo === true) {
video.pause();
}
beginListening();
return true;
}
}
//Monitor video and listen at certain point
_wq.push(
{
id: city_1,
onReady: function (video) {
video.bind("secondchange",
function (s) {
if (beginListeningAtPoint(video, s, 13, false)) {
return video.unbind;
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment