0

I have this code running great in ff, opera and chrome:

<script type="text/javascript">
                    $(document).ready(function(){
                      var swfUrl = "http://www.youtube.com/apiplayer?video_id=<?php echo bg_get_video_id($post->post_content)?>&enablejsapi=1&version=3&playerapiid=ytplayer_<?php echo $i?>";


                      // allowScriptAccess must be set to allow the Javascript from one 
                      // domain to access the swf on the youtube domain
                      var params = { allowScriptAccess: "always", wmode: "opaque" };

                      // This sets the ID of the DOM object or embed tag to 'myytplayer'.
                      // You can use this ID to access the swf and call the player's API
                      var atts = { id: "ytplayer_<?php echo $i?>", class: "ytplayer"};
                      var flashvars = {};
                      swfobject.embedSWF(swfUrl, "ytdiv_<?php echo $i?>", "300", "120", "9", null, flashvars, params, atts);
                    });
                </script>   

But not in Internet Explorer versions 7 and 8. It's a part of php file from Wordpress, but it's not important - video_id and ytdiv_ are all ok, it works in other browsers.

Is there anything I can do to make it work in IE? I don't have any ideas about what could have caused it.

Cheers, Nebril

2 Answers 2

2

Here:
var atts = { id: "ytplayer_", "class": "ytplayer"};

Type in quotes "class" and you are done. It helped me at least.

Sign up to request clarification or add additional context in comments.

Comments

1

I don't know whether it's the same problem I had, but I had to upgrade to the latest version of swfobject, 2.2 I think it is now, that solved it for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.