I have a Youtube Player in my Android app and I suddenly got a complaint from a customer that the full screen is not working anymore. So I checked my app and yep! The place where the 'full screen' button (bottom-right) should be, is now a cogwheel, which shows information about the video.
Did anyone else notice this/have this issue? I think I will need to handle the full screen now myself, or is it possible to force this button back?
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.
Device Info
Android Device: HUAWEI COL_AL10
Android Version: Android 9
Background
I develop an Android app to play YouTube video by YouTubeAndroidPlayerApi.jar, I choose native YouTube API instead of iFrame API.
Produce
Here is a Vertical-RecyclerView to display some YouTube Videos. I click the recyclerView's item and the video inside is to play, it's fine now.
Since I want to watch the YouTube Video in fullscreen mode, then I click the fullscreen button, trouble comes:
Summary
As soon as the fullscreen button clicked, the video playing ViewHolder in RecyclerView is detached and YouTube Player is released since the ViewHolder is removed or invalid said the RecyclerView.
However, my Activity is already landscape since YouTube fullscreen button clicked just now.
Why and how to fix?
Any suggestion will be appreciate.
guys
I finally solved the problem by code below:
youTubePlayer.setFullscreenControlFlags(0);
and then invoke Activity.setRequestedOrientation manually in onFullScreen callback.
That's it
I am using android-youtube api in my android project. I am using youtube fragment to play a youtube video.
Along with that video, I am playing other media (eg imageview) side-by-side. (I am aware that the youtube fragment should be always on top, so the problem is not related to this constraint).
I am able to play the video successfully, but the problem is, after video starts playing, the pause button does not fade out. It keeps showing that button. It seems like it fades out, but immediately after it disappears, it reappears.
I am not getting any logs related to this (not even in system log). However, when I play video fragment in full layout, there is no such problem.
In short, the problem occurs only when I play video along with some other media side-by-side. I didn't find any work around for this particular problem, so I don't have any code related to this problem.
How do I get rid of this issue?
Thanks in advance for help.
When you play video in YouTube app, at first it's full screen. When you click back button it goes to this mode:
I have seen similar thing made in this app.
How is it made? Is there any particularly library? Thanks.
I successfully implemented the bright cove in native Android. But Currently am facing some problem as,
When i press the video and Press HOME button, the Video starts from First
When i lock the screen and the unlock the screen, the Video starts from First.
Did any one come through this problem. Can share the knowledge.
THanks.
Are you extending the BrightCovePlayer or BrightCovePlayerFragment in your implementation? It will be nice if you share the code snippet for the player setup.