vimeo / player.js

Interact with and control an embedded Vimeo Player.
https://player.vimeo.com/api/demo
MIT License
1.44k stars 262 forks source link

Android Webview can not play view in Vimeo #951

Open KirylAkulich1 opened 1 year ago

KirylAkulich1 commented 1 year ago

Expected Behavior

Video should be played

Actual Behavior

video is not played.

Steps to Reproduce

Play video in web view. Literally few days ago videos worked well but now videos can not be played. Played only when user mute/unmute video.

jdreetz commented 1 year ago

Hi @KirylAkulich1 . Can you provide any more details about the context of this? Android/Webview version? A specific video or any video? Was it autoplay and autoplay stopped working without mute/unmute?

KirylAkulich1 commented 1 year ago

Hi. We have tested on Android 12/13. WebView version - Android System WebView 117.0.5938.60. Unfortunately I can not provide any videos( It not even started to play. I tried to tap play button, but nothing happened.But If I set MediaPlaybackRequiresUserGesture setting to false - everything works. Do you have any idea why it could happen?

jdreetz commented 1 year ago

Was the same code working previously in earlier versions of the Webviews? What does you code look like?

KirylAkulich1 commented 1 year ago

I can reveal some html element properties:

KirylAkulich1 commented 1 year ago

I have not updated web view. Previously video played correctly. Previously MediaPlaybackRequiresUserGesture flag was not used.

jdreetz commented 1 year ago

Are you able to see any debug information from the page loaded in the Webview? Like do you see any Javascript errors in the Javascript console for the page?

KirylAkulich1 commented 1 year ago

Yes I am. I do not see any specific errors.

image

I get some errors if try to drag progress bar

image
KirylAkulich1 commented 1 year ago

I have found a way to demo a problem:

https://github.com/vimeo/player.js/assets/62598669/0833181c-0336-47f0-8cea-4e2dbd66d0d5

Video plays only when it is muted. Code to reproduce https://codepen.io/KirylAkulich1/pen/WNLgzBK

KirylAkulich1 commented 1 year ago

I have found an interesting thing about playsinline=0& parameter. If I remove it then video is played fine in full/inline modes. So what we have now: If playsinline=0& is present in video url then video is played only if MediaPlaybackRequiresUserGesture is set to false in WebView settings. If playsinline=0& is not present then is played.

jdreetz commented 1 year ago

I have found an interesting thing about playsinline=0& parameter. If I remove it then video is played fine in full/inline modes. So what we have now: If playsinline=0& is present in video url then video is played only if MediaPlaybackRequiresUserGesture is set to false in WebView settings. If playsinline=0& is not present then is played.

Hey @KirylAkulich1, thanks for reporting this issue. I've added a ticket to our internal system to investigate. We'll reply to this issue when we have updates. Thanks!