Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video autoplay not working if video is on first slide #146

Open
fkohrt opened this issue Dec 30, 2020 · 6 comments
Open

Video autoplay not working if video is on first slide #146

fkohrt opened this issue Dec 30, 2020 · 6 comments

Comments

@fkohrt
Copy link

fkohrt commented Dec 30, 2020

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

  1. Put video on first slide
  2. Enable autoplay
  3. View presentation
  4. Notice that video doesn't play

Expected behaviour

Video should start to play.

@otacke
Copy link
Contributor

otacke commented Dec 30, 2020

@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.

@fkohrt
Copy link
Author

fkohrt commented Dec 30, 2020

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?

@otacke
Copy link
Contributor

otacke commented Dec 30, 2020

@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

@fkohrt
Copy link
Author

fkohrt commented Dec 30, 2020

Alright, I understand this is a web browser issue.

@fkohrt fkohrt closed this as completed Dec 30, 2020
@fkohrt
Copy link
Author

fkohrt commented Dec 30, 2020

However, even with...

  • the chromium switch --autoplay-policy=no-user-gesture-required and with
  • the policy AutoplayAllowed set to true

...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 fkohrt reopened this Dec 30, 2020
@otacke
Copy link
Contributor

otacke commented Dec 30, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants