Timing in video interaction

jcflach's picture

Hi H5P magicians. 

I am not sure if it is a bug or a lack in my skills/understanding. I'm using poster-type questions on top of YouTube video's. The video stops when the poster pops up. Both in the H5P editting interface as well as in the embedded H5P video's (website and Confluence wiki page) it looks like the video play sometimes stops a few frames BEFORE the actual poster pops up.

This behavious is inconsistent. I have tried adjusting the time parameters (start, finish, duration). To no effect unfortunately. Is there something I am missing? Lnk to example below. Please note that MOST of the time (80% or so) - alle works well. Suggestions welcome!

https://h5p.org/node/22032

fnoks's picture

From your example, I am not able to see any problems. But it might be I am using another browser? What browser are you using?

jcflach's picture

Hi, we're using Chrome. 

fnoks's picture

Hi,

I have looked at the current implementation, which checks 25 times per second if an interaction should be shown. It will not necessarily stop on the same frame each time. There is a relevant pull request here, which will make it possible to be more accurate in timing the interactions.

jcflach's picture

Hi fnoks, please note that a stop at the exact frame is not the actual problem. What happens now is that the video stops before the interaction is displayed. The user has to click on the Play button a couple of times and then the interaction pops up. As an example I have seen this happen in the last frames of (say) 00:13 when the interaction has to pop up in 00:14 (as specified in the editor. I would say the issue is that the video stop and the interaction popup need to happen at exactly the same time (frame?). 

otacke's picture

I was able to reproduce this behavior (kind of) with Chromium, if you are playing the video and if you then click right below a dot where the video would stop and the interaction would pop up. In fact, the video stops, but the interaction doesn't pop up until you hit play again.

I was not able to reproduce this, though, if playing a video without clicking on the slider right below a button.

fnoks's picture

I see. What you are experiencing is clearly a bug. We will look at it as part of the upcoming release. But first we need to be able

Which version of Chrome are you using? And what operating system are you on?

otacke's picture

At home, I am using Chromium on Ubuntu Linux. Right now, I could reproduce the problem on Windows 7 with Chrome (Version 52.0.2743.116 m), Opera (39.0.2256.48) and Firefox (48.0), but interestingly enough not with IE 11. Again, its behavior is different compared to other major browsers - at least in a good way for once ;-)

jcflach's picture

Windows 10 and Chrome 52.0.2743.116 

fnoks's picture

Thank you. We will try to reproduce!

icc's picture

It looks like the YT videos are having some time sync issues. Every time I press pause and play the video jumps 40-80 ms backwards. This happens when seeking or pausing for interactions as well. I've created a workaround delaying the pause by 100ms for YT videos: 8481d9a

This should fix the issue without misaligning the video and the interaction too much. Again, this is an issue YT is having and hopefully, they will fix the main cause of the problem soon so that we may remove this fix again. The fix will be part of the upcoming release.

Thank you for reporting and providing information regarding this issue.

jcflach's picture

The 100ms patch works flawlessly for my video content. Thanks!

fnoks's picture

Great :)