In javascript, you get the current time of an HTML5 video with the currentTime attribute.
Youtube uses complex tricks to make its video player work so it doesn't use the default HTML5 video API, but default HTLM5 is rather easy to understand and manipulate.
Try to do it for pure HTML5 videos, and then you can try to do it with the fancy Youtube API.
document.getElementsByTagName('video')[0].currentTime
Here is the list of all HTML5 events and attributes:
http://www.w3.org/2010/05/video/mediaevents.htmlYou can see the timeupdate event.
So you just have to do something like
$('#myvideo').on('timeupdate', function() {
if video.currentTime > popupTime and previousTimeupdateEventTime < popupTime) {
video.pause();
cleanPopupBlock();
displayThePopup();
}
previousTimeupdateEventTime = video.currentTime;
});
To do this, you will need to create a new XBlock.
This will require some work to create such a XBlock (I don't know if you are already familiar with XBlock development or not).
Marceau C.