I have a problem with playinh youtube videos in my app.
I have a page with embed video. When i tap on video, loader appears, everything is ok.
When loader dissapears, it should start playing. But in my application there is white screen appears.
On LogCat at this moment i can see this:
CordovaLog showing Custom View
Problem fixed, by using plugin.
But, i have the same problem with VIMEO.
This plugin will help you to play a YouTube video in a Phonegap/Cordova app:
https://github.com/remcob00/cordova-phonegap_youtube_player_api_android
Related
I am using embedded YouTube videos in my React Native Expo application. The embedded videos are inside a WebView from react-native-webview. I am having a bit of a weird problem and I am not sure if it is on the YouTube side or React Native side of things.
When I try to click the play button on Android, I get the developer options on the YouTube video. The video does not play and I cannot "click out" of these options.
What the YouTube Embedded Video looks like inside the WebView when I press play
Even though I am clearly clicking in the center of the player on the play button, I get this menu. It seems like the Webview is either not responding well to user touch input or it thinks it is a longPress. I am not long pressing the video. When I strip my UI down to just the WebView taking up the entire screen, it works fine. On long press, I see this menu pop up. But clicking the play button everything works as expected.
It seems like once I reduce the size of the WebView (even though the YouTube player is not cut off or squished at all), it isn't responding properly. On iOS, everything is working fine.
Device Problem Occurs on
When I started to test on the Samsung Galaxy S7, I noticed this problem. Running the application on a Google Pixel 3 emulator appears to work as expected.
Here is the simple WebView with embedded YouTube video in it.
<WebView
allowsInlineMediaPlayback={true}
source={{ uri: "https://www.youtube.com/embed/WOi0vnzcEzA?playsinline=1&rel=0&mute=1autoplay=1&fs=0" }}
/>
Thanks
I ended up figuring out what was going on. I hope this may help someone in the future.
My WebView was wrapped inside a TouchableWithoutFeedback. For some reason (it is probably correct behavior but over my RN capabilities), it was "blocking" proper user input into the WebView. After I moved the WebView outside of the TouchableWithoutFeedback, everything worked as expected.
I look for this famous solution Playing HTML5 video on fullscreen in android webview. But even their own project is not working while I run it to my device(Nougat). Youtube videos are not go to fullscreen while clicking on that square box to go to fullscreen. What can I do in farther?
use link below for showing video in android:
ExoPlayer
I'm trying to set a video in my Cordova 2.9.0 app by using the HTML5 video tag, I have already tried the Plugin https://github.com/macdonst/VideoPlayer but still doesn't work.
When I run my app all I see is a white square where I should be seeing the poster of the video with the controls and when I want to play it an error message ("Sorry, this video cannot be play") shows up.
I've read a lot about this but couldn't find any solution that works.
Any suggestion?
Your browser does not support the video tag.
I'm developing an app with html, css and javascript which i port trough Phonegap to play on an Android tablet. (android 2.3.1 Gingerbread)
Everything is working fine, except the Youtube embed.
If i place the iframe embed on my page there is no play-button above my youtubescreen, so the user does not know he has to press it. But if you press it, the movie loads into the external android video playing app.
But here's the second problem; when the movie ends, the external android player closes and returns to my app, but then my youtube video screen is black en has these ugly android videocontrols of the external player.
But i can't do anything with it... so the user can't press the movie to watch it again.
Does anybody know how to implement a youtube video correctly into an HTML based android application?
It's HTML, so webviews, videoview, intents and things won't work...
Things i tried:
iframe embed
object embed
html5 video embed
online embed on external page
but in every attempt, those ugly videocontrols keep popping up after the video ended.
I also tried another player, but with the same result... Anyone ideas? :-)
I am connecting to a website which hosts youtube videos via webview. When I click on the youtube video it works fine - the player plays within the webvideo window. But when I make the video full screen it plays. But when I press the back button - it goes back to the webview and I can navigate to the rest of my app - but I can still hear the video play in the background. Whats happening here?
I had a similar problem and found a solution here on StackOverflow. I don't have link to that question though.
Here it is:
webview.loadData("", "text/html", "utf-8");