YoutubePlayerView goes black when i scroll down inside recyclerView

流过昼夜 提交于 2019-12-08 12:04:39

问题


I have a recyclerview that will show all videos from youtube. i'm using YoutubePlayerView to display it. The problem is everytime i scrolls down half screen the current video screen goes black and will not load anymore. The videos will load just fine if i don't scroll half screen

Anybody know about this behavior?


回答1:


The YoutubePlayerView has to be fully visible, otherwise the video gets stopped. Since you are putting it in a recyclerview part of the YoutubePlayerView is not fully visible when scrolling and gets stopped.

In the documentation it says: Also, it is not permitted to overlay the view with other views while a video is playing. On the documentation page. You are probably not overlaying the video, but you are obscuring certain parts of the video when scrolling.



来源:https://stackoverflow.com/questions/37903786/youtubeplayerview-goes-black-when-i-scroll-down-inside-recyclerview

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