Monday, April 23, 2012

[YouTube-API] Player doesn't work after I change the video container's opacity

I have my player set up so that it's in a div container called videoContent which fades in and out when the user clicks on the "close" and "replay" buttons, respectively.  

When I remove the fade functionality:
$('#videoContent, .btnClose').fadeOut('slow');

everything works fine - I can stop the video, seek to the beginning and restart playing it.  When I add back the fadeOut() function, I get the error: 

"Uncaught TypeError: Object #<HTMLObjectElement> has no method 'seekTo'"

It seems that the reference to the Youtube player is no longer available. This is incredibly frustrating.. Essentially, changing opacity to 0 makes the videoContent div get the attribute "display: none" but it's still in the DOM... How do I get around this??

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/V_aMQkOaFfoJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment