PauseVideo () in IE8 for youtube video, gives "Object does not support this property or method"

when trying to use pauseVideo () in IE8 for youtube video, it gives me "Object does not support this property or method",

here is my embedded video:

<div class="ytLarge"> <object width="400" height="300"> <param value="http://www.youtube.com/v/Y4EZULqhP2E" name="movie"> <param value="true" name="allowFullScreen"> <param value="always" name="allowscriptaccess"> <param value="transparent" name="wmode"> <embed width="400" height="300" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/Y4EZULqhP2E&autoplay=1&version=3&enablejsapi=1"> </object> </div> 

and here is the challenge:

 $('embed').each(function(index){ $(this).get(0).pauseVideo(); }); 

the code works fine in firefox and chrome, but gives "Object does not support this property or method" in IE8 in the line $ (this) .get (0) .pauseVideo ();

+4
source share
1 answer

For what I remind the <embed> , IE is not recognized, so the <object> tag is also used like this:

<object> for IE (why your script crashes in IE)

<embed> for all other browsers

0
source

Source: https://habr.com/ru/post/1414723/


All Articles