问题
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