Here is my code:
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <title></title> <script> $(document).ready(function(){ $("#video").html('<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/HPPj6viIBmU&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HPPj6viIBmU&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>'); }); </script> </head> <body> <div id="video"></div> </body> </html>
It works with Firefox and Chrome, but something is not entirely true in IE6. Unfortunately, one of the project requirements supports this browser, so even if it works in IE7, I need to do this.
I know SWFObject there, but I would prefer not to use it (we are already loading a bunch of JS files, we no longer need it).
Even this will not work:
<script> document.write('<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/HPPj6viIBmU&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HPPj6viIBmU&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>'); </script>
IE6 seems to be ignoring the <object> , here is the code that it inserts.
<EMBED src=http://www.youtube.com/v/HPPj6viIBmU&hl=en_US&fs=1& width=480 height=385 type=application/x-shockwave-flash allowfullscreen="true" allowscriptaccess="always"></EMBED>
Is there any workaround?
Thanks.
javascript jquery flash internet-explorer-6 video
metrobalderas
source share