1

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

Carlos F
  • 893
  • 2
  • 12
  • 30

1 Answers1

1

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.

Ribesg
  • 358
  • 4
  • 15
  • 1
    Could you share the advantage of 1 vs 2? Are u saying that 2 would technically violate google TOS? – Carlos F Feb 19 '16 at 10:02
  • @CarlosF I edited my answer :) Basically if you manage to get the first solution to work for you, then go for it. The second one is more like the emergency solution, which I was forced to use because of the _extremely low_ quality of this API. – Ribesg Feb 19 '16 at 10:20
  • @Ribesg Is there any sample for dialog or dialogfragment?plase see my stackoverflow question http://stackoverflow.com/questions/36424468/is-it-possible-to-place-the-overlay-view-in-youtube-player-view-in-android – Rajesh Apr 07 '16 at 04:51
  • @CarlosF Please see my answer here http://stackoverflow.com/questions/33998568/actionbar-overlaying-youtubeplayersupportfragment-from-youtube-player-api/34287965#34287965 – Ribesg Apr 08 '16 at 07:04