开发者

FLV PLAYBACK: changing dynamically flashvars.streamName after initial load

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 a开发者_运维百科ttributes = {};
        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.


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜