Search code examples
androidandroid-youtube-api

How to put a layout over a YouTube player while it is in fullscreen mode?


I’m trying to put a layer over a YouTube player in fullscreen mode. I’ve tried putting a layout over YouTube through the xml but it isn’t visible when YouTube is in fullsreen mode. Is there a way I can put a custom button or layout over the YouTube player in fullscreen mode?


Solution

  • You cannot put a layer on top of Youtube Player. Whenever an overlay is detected, the youtube playback stops playing. For more info

    Note that while videos are playing, this View has a minimum size of 200x110 dp. If you make the view any smaller, videos will automatically stop playing. Also, it is not permitted to overlay the view with other views while a video is playing.

    You can put a layout outside the player or use Overlay ActionBar