I have activity with YouTubePlayerSupportFragment inside it to play youtube video.
The style of the YouTube player is set to CHROMELESS (video only, no control), and playback is controlled by my own play / pause button outside of the player. Each thing works as expected, until the moment when I leave the video activity for some reason, and then return to it.
When an action is exited, the video pauses - as expected, but after returning to it, the request to player player.play() does nothing. No errors and exceptions, he just does nothing. Play() will only work after loading a new video.
I am trying to use YouTubePlayerFragment instead, but the result is the same. However, when using the DEFAULT style, pressing the default play button will apparently reload the video (I see that the buffer is clearing) from the previous position and work as expected. This makes me believe that they are processing it somehow directly on their user interface control code, and not on the playerβs API.
I can reproduce this problem on a sample of custom SDK controls by simply starting the video by pressing the recents key and returning to it, so I find it safe to assume that this is a mistake. Has anyone been able to work around this problem? is there any way to detect that the video needs to be reloaded before it is fixed?
Info: I am using the YouTube player API for Android v1.2.2 and the latest youtube v10.49.59 application
source share