ihadeed / CordovaYoutubeVideoPlayer

Play Youtube Videos in a native Video Player on Android & iOS
MIT License
23 stars 49 forks source link

The video on Android stops after a few seconds to pause. #17

Open Riabov54 opened 3 years ago

Riabov54 commented 3 years ago

The first video on Android works fine, but each subsequent video is stoped immediately after the start to pause. The screen turns black. The focus is lost, and it is not possible to continue it manually. If you switch to another app and then return, the video waits for the manual continuation of viewing. This happened after the recent Google updates to WebView. How do I eliminate these pauses? In config.xml recorded: preference name="AllowInlineMediaPlayback" value="true" preference name="MediaPlaybackRequiresUserAction" value="false"

piotrmocek commented 3 years ago

I'm trying to resolve same problem. Any thoughts on that?

nadamai commented 3 years ago

I have got exactly same problem. Updating WebView/Chrome according to this article: https://www.xda-developers.com/google-confirms-webview-issue-crashing-android-apps/

does not work. Any help would be highly appreciated.

nadamai commented 3 years ago

I've found temporary solution. Its disadvantage is that the video does not open on fullscreen.

About the fix: YouTube API method createPlayVideoIntentWithOptions in src\com\bunkerpalace\cordova\YoutubeVideoPlayer.java seems to cause the problem. Setting 3rd argument to false (it turns off fullscreen) and going fullscreen manually may help to understand where the problem lays.

I've commented out YouTubeIntents.canResolvePlayVideoIntentWithOptions condition in createYoutubeIntent method and left the content from else clause, where the intent is created without YouTube API and it seems to work fine.

Riabov54 commented 3 years ago

The problem is full screen mode and hiding the user interface. If you click on the fullscreen icon while watching a video, the user interface appears and the next video goes without problems. I have tried the cordova-plugin-fullscreen plugin. This does not solve the problem. The video needs to be shown, but the user interface is present on the screen.

santoshbadal1111 commented 3 years ago

On Android devices when we play youtube video for the first time it works perfectly but once we close video either by back button press or auto closes on video finish. now if we try to open the video on the same page then youtube video player is coming with black screen. It would be great if someone have already fixed it. Please help.

jamesdss commented 3 years ago

same issue here.. please help!