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

Compatibility fix - Fixing autoplay in Cordova Android apps #198

Closed
Techn1c4l opened this issue May 13, 2021 · 1 comment · Fixed by #204
Closed

Compatibility fix - Fixing autoplay in Cordova Android apps #198

Techn1c4l opened this issue May 13, 2021 · 1 comment · Fixed by #204
Assignees

Comments

@Techn1c4l
Copy link

Techn1c4l commented May 13, 2021

I've been dealing with this problem for a very long time.

The issue is the video stream does not start automatically when being implemented in a Cordova Android app. Eventually I've ran out of solutions and just resorted to simulating a screen tap which indeed helped.

But today I've found the true reason of this behavior.

Setting muted property of an HTMLVideoElement will not count as muted video for an Android WebView.

This does not work:

videoElement.muted = true;

You have to add the muted=true attribute.

This is the proper way:

videoElement.setAttribute('muted', true);

Basically as I understand, the Android WebView will ignore autoplay attribute if it doesn't detect a muted attribute.

Please implement this fix. There is a lot of frustrated people out there who were not able to solve this for years. This issue seems to be unique for Android WebView.

@mebjas mebjas self-assigned this May 28, 2021
mebjas added a commit that referenced this issue May 28, 2021
[Issue#198](#198) fixed - Fixing autoplay in Cordova Android apps
mebjas added a commit that referenced this issue May 28, 2021
[Issue#198](#198) fixed - Fixing autoplay in Cordova Android apps
@mebjas
Copy link
Owner

mebjas commented May 28, 2021

Thanks for the bug and suggestion, merged to master. Will be published soon!

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

Successfully merging a pull request may close this issue.

2 participants