ouyang789987 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

static publishing method can't use .play() or .loadvideobyid() #622

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. embed video using static publishing method from here: 
http://code.google.com/p/swfobject/wiki/documentation
2. use registerObject with a callback to capture the reference to the object
3. try to use any of the methods from the youtube api such as loadVideoById() 
or play()
https://developers.google.com/youtube/js_api_reference
4. those methods are undefined in the object reference returned in the callback 
passed to registerObject

What is the expected output? What do you see instead?
these methods work if I use dynamic publishing
I was expecting to be able to use all of the methods listed here just as I can 
with the dynamic publishing method.
https://developers.google.com/youtube/js_api_reference

What version of the product are you using? On what operating system?
2.2 mac osx firefox and chrome

Please provide any additional information below.

code snippets:
js:
        swfobject.registerObject("myMovie0", "10", "", function(e){
                        //try to do something with the player           
                        e.ref.loadVideoById(videoID);
                        e.ref.play();
        });
html:
<object width="425" height="356" 
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myMovie0" 
style="visibility: visible;">
            <param value="http://www.youtube.com/v/_DofZYPYOxM?enablejsapi=1&amp;playerapiid=ytplayer&amp;version=3" name="movie">
            <!--[if !IE]>-->
            <object width="425" height="356" data="http://www.youtube.com/v/_DofZYPYOxM?enablejsapi=1&amp;playerapiid=ytplayer&amp;version=3" type="application/x-shockwave-flash">
            <!--<![endif]-->
              <p>You must have flash installed to see this video</p>
                <p><a href="http://www.adobe.com/go/getflashplayer"><img alt="Get Adobe Flash player" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"></a></p>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
            </object>

this may not be a bug... it might be user error :)

Original issue reported on code.google.com by dallas.d...@gmail.com on 10 Mar 2012 at 1:18