如何通过Javascript在Flowplayer中更改视频(并立即开始播放)?

时间:2009-06-17 16:19:09

标签: javascript flowplayer

无论视频当前是否已加载并播放,都应更改视频并开始播放。

感谢。

4 个答案:

答案 0 :(得分:6)

请参阅下面的示例,其中api是您的flowplayer实例,而replaceclip是您要开始电镀的实例

var api = flashembed("player", {src:'FlowPlayerDark.swf'}, {config: ...}});
var replaceclip = {'url':'myvideo.mp4', 'autoplay':true};

<button onClick="api.playClip(replaceclip)">Play</button>

答案 1 :(得分:2)

在Github https://github.com/Teaonly/android-eye/blob/master/assets/droideye.js

中查看我的示例
var initAudioPlayer = function () {
    // install flowplayer into container
    // http://flash.flowplayer.org/

    $f("player", "flowplayer-3.2.15.swf", {
        plugins: {
            controls: {
                fullscreen: false,
                height: 30,
                autoHide: false,
                play: false,
            }
        },
        clip: {
            autoPlay: false,
            url: "stream/live.mp3",
        }
    });

    audioPlayer = $f();
};

var newClip = {'url':'stream/live.mp3?id='+audioCount,'autoplay':true};
audioCount ++;
audioPlayer.play(newClip);

答案 2 :(得分:1)

 $f().play([{url:'yourmovie.flv'}]);

通过这种方式,您可以在Ajax中动态更改视频。

答案 3 :(得分:0)

您可以查看流程图here

的javascript api

具体来说,您可能想要查看流媒体对象'Clip'和'Player'