开发者

jquery: checking if embedded youtube video is loaded - ready to play?

开发者 https://www.devze.com 2023-02-10 03:21 出处:网络
hey guys, i\'ve a embedded youtube video on my page. <div class=\"vidwrapper\"> <object class=\"video\" width=\"308\" height=\"25\"><embed src=\"http://www.youtube.com/v/GfugtAWxooU?fs

hey guys, i've a embedded youtube video on my page.

<div class="vidwrapper">
    <object class="video" width="308" height="25"><embed src="http://www.youtube.com/v/GfugtAWxooU?fs=1&amp;hl=de_DE&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="308" height="25" wmode="opaque"></embed></object>
</div>

my .vidwrapper has a green background a开发者_运维知识库nd i can see that background as long as the video is not loaded onto my page.

i wonder how i could check for the moment the video is loaded onto my page?


use load() to ensure the video and wrapper are loaded before displaying on the page. This will prevent the green box from showing while video is loading.

http://api.jquery.com/load-event/

0

精彩评论

暂无评论...
验证码 换一张
取 消