I have an app with fragments and inside those fragments I have frame layout into which I add YouTubePlayerSupportFragment. But when I click full screen then this exception is thrown:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.xxx/com.example.xxx.MainActivity}: java.lang.IllegalArgumentException: No view found for id 0x7f040039 (com.example.xxx:id/frame_youtube) for fragment YouTubePlayerSupportFragment{4282a068 #11 id=0x7f040039}
How to disable “YouTube.com is now fullscreen. Press Esc at any time to exit” message in Firefox When you are watching a YouTube video in Mozilla Firefox, every time you switch to fullscreen mode, the browser shows the following message: YouTube.com is now fullscreen.
I've added code to do fullscreen ( real full screen, not full window) to my answer on Auto-Full Screen for a Youtube embed. YouTube don't expose fullscreen in their API, but you can call the native browser requestFullScreen () function from the playerStateChange () event from the YouTube API or make your own custom play button like I have.
If you want to show full screen, youTubePlayer.setFullscreen(true); If you want to hide full screen buttonafter full screen or even in the portrait mode the youTubePlayer.setShowFullscreenButton(false); You can also use PlayerStyle Option, provided in the newest API
The function indicates that when the player state is 1 (playing), the player should play for six seconds and then call the stopVideo function to stop the video. After the API's JavaScript code loads, the API will call the onYouTubeIframeAPIReady function, at which point you can construct a YT.Player object to insert a video player on your page.
Or you can just disable it by 1 line:
player.setShowFullscreenButton(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With