Android Youtube : Video turns black - android

I was working on YouTube player in my Android app using the Javascript API. I had faced some issue, which I raised on a separate question:
https://stackoverflow.com/questions/34786950/android-youtube-remove-buffering-indicator
I have faced another problem that sometimes on Samsung Note 4, the Youtube video becomes invisible, though the webview for Youtube is visible. Here are a couple of screenshots:
As evident from the screenshot, the YouTube ads and subtitles are completely visible, but the video itself is not.
Can anyone point out a solution, or a possible cause why this is happening?
PS : I have not added the code in this question, because the code is the same as this question : https://stackoverflow.com/questions/34786950/android-youtube-remove-buffering-indicator

Related

YouTube Embedded Video Shows Developer Options when Click Play Button on Android

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.

Cannot load modern controls UI. Unable to play YouTube videos in full screen

I recently have updated YouTube Android Player API to 1.2.2 (the latest version), but it keeps telling me
16445-16445/com.* W/YouTubeAndroidPlayerAPI﹕ Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.
, when I try to put a video on the fullscreen mode. In addition, the video stops playing and it appears, that it can’t be played anymore (it stucks). What’s even worse, when you press back, it does not allow you to play the video in normal mode, so, basically, you have to reload the activity. I’m using YoutubePlayerSupportFragment. I guess, that the general YouTube app update might have ruined it. I have noticed, that the full screen mode worked smoothly before.
How to overcome with this problem? Thanks in advance.
When you extend AppCompatActivity, It causes 2 following problems:
It causes error UNAUTHORIZED_OVERLAY when playing in fullscreen. Because the statusbar is on the top of YoutubePlayer.
Solution: set FULLSCREEN_FLAG_CUSTOM_LAYOUT to hide the status bar manually.
YouTubeAndroidPlayerAPI﹕ Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API.
The UI of YoutubePlayer looks so bad. It just happens when extending AppCombatActivity. Updating the latest youtube api doesn't work.
If you find the solution of the 2nd problem, please let me know.

Iframe for youtube video loads and then disappears on android chrome

I am adding an iframe to display a video from youtube, the video appears fine and responsive across all devices except on android mobile chrome browser.The video appears for a second then disappears. On inspecting the element in chrome developer tools I can actually see that the Div that contains my iframe becomes empty after a second.
I have tried putting it in the flex video container provided by foundation (the site is using zurb foundation for responsive design) but still the issue persists, in fact no iframe video container is staying for more than a second. Any help is highly appreciated.
I have red these questions, but none of them solve my issue
AngularJS: Embedding Youtube videos in iframe does not work on Android Chrome
youtube video quickly disappears
Why is my iframe video disappearing?
I dont have rights yet to post an image so i am sharing the snapshot here.
http://i61.tinypic.com/vfwjnk.png
The fullscreen-video-container in the class of the div which holds the iframe. You can see the div becomes empty after a second.
The console has no errors
This was the first post I found on the topic. Ran into this just the other day. I had the embed URL variant so I was confused. This is all very simple. Realized it was a WordPress plugin trying to do tricky things with regex and handling it's own embed trickery. Disabling the related plugin made things work.

Infinite buffering in YouTube API

Play any YouTube video .Pause and forward the video, buffering loader shows and the play icon not appearing. End Result : Infinite loading occurs.
I don't know if this really answers the questions, but I was having a similar issue with infinite loading.
Basically I would play a video using a player fragment, exit the video, and then the next video I would try to play would display an infinite loading indicator.
This issue was only happening on certain devices.
Since I was using the latest version of the youtube api, I updated the youtube app on the problematic devices and that seemed to resolve the issue.
Hope this helps.

android chrome embed video shows in full screen only

I made a static website tool that runs in all major browsers and iPad and Android(chrome). I show .mp4 video source with a simple embed tag. This was working just dandy until sometime this weekend. Come monday testing the video in android chrome, it plays audio only when not full screen, and plays correctly when full screen. I tested with the html5 video tag I use in other tools and actually same bug. I converted the video to other formats and codec, same bug. I tested tools that were completed months ago and working perfectly when sold, same bug. Seems likely that it started when chrome updated sometime after the 10/11 over the weekend. But as this project is on the home stretch and I had just debugged the last bugs I am putting it out there hoping for some feedback. I can't be the only one as it is happening with the video tag as well as the embed tag. It has to be chrome that changed my code didn't. Any insights out there?

Categories

Resources