Open jeffposnick opened 9 years ago
Should I switch over to using this or should we wait?
Hold off. I haven't started looking into the Player API issue, so there's still a risk of the thumbnail not disappearing when things bug out.
Ping.
Right. https://github.com/GoogleWebComponents/google-youtube/pull/34 might have helped—the error I was seeing was triggered after loading/closing the <google-youtube>
element a few times, and the cleanup being done in that PR could address some of it. (Or it may just be a Player API bug.)
I'll report back.
Unfortunately, it's still reproducible.
I've narrowed things down to the initial play
state change event not firing, though everything else seems to be working when it happens—the Player API loads, and the paused
+ ended
state change event do fire once the video is over.
I'll raise an internal bug with the YouTube Player API team based on what I'm seeing.
An update on this: I've been trying and failing to reproduce the issue in a standalone demo, which makes it infeasible to file a bug about it.
http://jsbin.com/wekicu/5/edit?html,output should trigger the issue, based on what I'm seeing in the context of the I/O app, but it doesn't.
There's a new
<google-youtube playbackstarted>
attribute, and it would be nice to use it like:to trigger the thumbnail fade in/out. However, I'm seeing sporadic cases where the YouTube Player API event handler isn't firing, causing
playbackstarted
not to be set totrue
. Since this would mean that the video playback starts but is completely obscured by the thumbnail, it's not worth the risk of implementing this new logic.Once the underlying issue with the Player API can be diagnosed and fixed, I'll revisit.