Black patch youtube android api

别等时光非礼了梦想. 提交于 2019-12-09 13:58:19

问题


I have implemented youtube player api for android, when I put youtube player inside the scrollview and start the video, the moment I pause the video and scroll the screen up and down it has black patch with it.

I could not get why the black patch is coming over?I tried to capture the screen but the screenshot does not have the black patch.

Below is my code :

<com.google.android.youtube.player.YouTubePlayerView
            android:id="@+id/youtube_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            />

回答1:


the black patch appears because the video view uses a SurfaceView. The real view is a "black hole" and the video is underlaid by hardware. Any direct manipulations to the view layout cause this view stacking to desynchronize: you are in fact seeing Android's underwear, and you will see that different phones/tablets react differently, for example in my older galaxy tabs this effect is very noticeable, while the newer, faster Amazon Kindles do much better jobs.

There's nothing you can do about it. This is related to Android's graphic internals, they need to fix the engine to allow better scrolling of surfaceviews.



来源:https://stackoverflow.com/questions/19145799/black-patch-youtube-android-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!