Milo
Milo

Reputation: 1017

YouTubePlayerSupportFragment within a SlidingDrawer

I am trying to place a YouTubePlayerSupportFragment within a SlidingDrawer view. However, when it runs the video is stopped after 1 second and the follow is posted in LogCat:

W/YouTubeAndroidPlayerAPI(1778): YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is obscured by ViewName{41726520 V.E..... ........ 0,0-720,1038 #7f060040 app:id/drawer}. YouTubePlayerView is completely covered, with the distance in px between each edge of the obscuring view and the YouTubePlayerView being: left: 0, top: 241, right: 0, bottom: 392..

The SlidingDrawer is opened and the video is completely visible and not obscured. Does anyone know a solution to this?

Thanks

Upvotes: 3

Views: 795

Answers (2)

Yarh
Yarh

Reputation: 4617

from ducumentation youtube player shoudbe topest element and have minimal size of 200*110 dp. If it is smaller - player will stop. If any view (even invisible) will overlap the youtube player - player will stop

Upvotes: 0

Ralph Mueller
Ralph Mueller

Reputation: 174

I had the same issue, I was changing the margins of the YouTubePlayerSupportFragment,where the distance was negative until it worked. Not sure why this happens though.

Upvotes: 1

Related Questions