i have video youtube embed in website.
i want know if can show me how check if video paused. here code:
<img id="imagevideo" src="assets/img/landingpage-videothumbnail02.jpg" data-video="http://www.youtube.com/embed/mm9dztc0ipk?autoplay=1" alt="" width="100%" height="274px" />
this script when image clicked, video played:
$('#imagevideo').click(function(){ video = '<iframe src="'+ $(this).attr('data-video') +'"></iframe>'; $(this).replacewith(video); });
here have been trying check if video paused:
var paused = $("iframe .html5-main-video").paused; if(paused) { alert ("it paused"); }
that because when inspect element, video of youtube has class of html5-main-video.
but doesn't alert function.
help, please. thanks
Comments
Post a Comment