views:

174

answers:

1

I have simple playback set up:

    <script type="text/javascript">
        var flashvars = {};
            flashvars.skinName = "Clear_Skin_1";
            flashvars.streamName = "movies/FLV768KB.flv";
        var params = {};
        var attributes = {};
        swfobject.embedSWF(
                "FLVPlayer_Progressive.swf", 
                "myAlternativeContent", 
                "320", 
                "240", 
                "9.0.0", 
                "swfobject_2_2/expressInstall.swf", 
                flashvars, 
                params, 
                attributes
                );
        </script>

the goal is to change video playback on the fly, let say i have bunch of videos to choose from. Playback starts with one video, and user clicks on thumbnail in html portion of the page and I want the click to reflect on the video playback of another video from the list.

1) Is there a native support with out modifying the actual player and adding extra AS to support callback. hens changing dynamically flashvars.streamName after intial load?

2) If NO is the answer for 1) then should i just remove the div that holds flash player instance from dom, change flashvars.streamName instance to new movie and then add new instance of flash player container to embed new instance and load the next movie?

thank you so much in advance.

+1  A: 

You could use ExternalInterface to communicate between Javascript & Flash , use flashvars to load the first video but after that you can send the next video url from Javascript. Have a look at this example with the swfObject test suite and you'll see how you can send a variable value in that way

http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_com2.html

Check the docs for the ExternalInterface class http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/

PatrickS
thank you, will check it out in a bit. I got it going for now with dom manipulation.
GnrlBzik
thank you PatrickS that's what i needed.
GnrlBzik