Search code examples
android-youtube-api

"Unauthorized" overlay on Android YouTube player supported?


I am looking at the Android PlutoTV app and trying to get a similar effect.Note the overlay on top of the video

Now, just to prove that this video is indeed from YouTube, see the next screenshot: Video from YouTube

I would very much appreciate if someone could explain how this overlay effect is obtained notwithstanding youtube's player restrictions.

Kindly help!

Cheers


Solution

  • There are two ways to overlay the Youtube Player:

    1. Using an ActionBar, as described in one of the samples
    2. Using a Dialog or DialogFragment. In this case your view(s) overlaying the player aren't part of the view hierarchy and can't be detected by the youtube player.

    EDIT: About 1 vs 2

    The first solution is the "official" way to overlay controls/whatever over the Youtube Player. It was difficult for me to use because it simply didn't work after days of trying. That's why I'm using the second solution, which is technically against the ToS.

    But I've just got a small semi-transparent bar at the bottom of the player which disappears after 2 seconds, so I don't think I will have any problem anyway.