-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
programmatic play() not working Chrome Android #4288
Comments
This might be related to #3131 |
Yeah, it is definitely related to that issue. Calling
EDIT: You will still see a console message because, at multiple points with |
@coryc5 I am not sure if this helps, but by calling the src before the ready it seems to do the trick. |
You need to set 2 attributes for the video tag. This made it work for me. |
We have improved autoplay/muted support in the player greatly in the latest versions of v5 and v6. Though, v6 has some other extra fixes. |
Description
As of Chrome for Android 53, video autoplay is now allowed as long as the video is muted. I have found a scenario where autoplay will not work with video.js even if the video is muted.
Example:
https://jsfiddle.net/0u0x42ed/2/
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
Results
Expected
The expected result is that the video plays.
Actual
The video does not play
Error output
Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.
Additional Information
This is not a problem on iOS and it is also not a problem when setting the source through HTML, see:
https://jsfiddle.net/0u0x42ed/6/
Even though there is an alternative way to achieve autoplay without the error, this is not an approach that works when you are serving a DASH video, given that programmatically setting the src is the only way that currently works with DASH as of videojs 5.10+, see:
#3428
versions
videojs
5.19.1
browsers
Chrome for Android 56
OSes
Android
The text was updated successfully, but these errors were encountered: