h5p-course-presentation
h5p-course-presentation copied to clipboard
Video autoplay not working if video is on first slide
Summary
If I enable autoplay for a video that is on the first slide, it does not play automatically when the presentation is viewed. Only if one goes to the next slide and back again the video starts to play.
Steps to reproduce
- Put video on first slide
- Enable autoplay
- View presentation
- Notice that video doesn't play
Expected behaviour
Video should start to play.
@fkohrt This is not a bug, but browser policies kicking in. They decide whether a video will autoplay or not before the user has interacted with the web page.
Please compare https://developers.google.com/web/updates/2017/09/autoplay-policy-changes for instance.
I see, I didn't think about that. However, in my case the video is muted (has no audio track) and it plays fine if I manually add the attribute autoplay. So shouldn't it play fine in H5P as well?
@fkohrt Muted videos are a special case of its own (see the link above). There's still just a general ruleset (not a guarantee) for autoplaying even if the autoplay attribute is set, cmp. https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide#Autoplay_availability
Alright, I understand this is a web browser issue.
However, even with...
- the chromium switch
--autoplay-policy=no-user-gesture-requiredand with - the policy
AutoplayAllowedset totrue
...I can't get the video to play, so it seems to me this is not a browser policy issue.
How to change Chromium's policy on GNU/Linux
Write the following to /etc/chromium/policies/managed/test_policy.json:
{
"AutoplayAllowed": true
}
Verify that it works at chrome://policy/.
Source: Chromium Documentation for Administrators > Linux Quick Start
@fkohrt Interesting find!
It seems that Course Presentation takes control over autoplaying and media instances are only autoplayed when switching the slide. Not sure it that's a bug or in fact intended behavior. I guess the H5P core team will have to answer that question.