开发者

Stop flv looping

开发者 https://www.devze.com 2023-01-26 12:34 出处:网络
I have a video player swf which loads in a flv file via flashvars. This works perfectly, but when it reaches the end it loops ie Goes back to start and plays again. This only happens开发者_JAVA技巧 wh

I have a video player swf which loads in a flv file via flashvars. This works perfectly, but when it reaches the end it loops ie Goes back to start and plays again. This only happens开发者_JAVA技巧 when it is embedded in a page because when I press cntl+Enter to preview as swf alone it works.

It's loaded via netstream. Here's the last bit of code...

var isPlaying:Boolean;
isPlaying = false;

var video:String;
video = _root.videoURL;


if (video == undefined) {
    video = "http://www.masterseries.co.uk/public/TempFiles/Concrete1.flv";
}


function playVideo() {
    isPlaying = true;
    trace("Play Video...");
    _root.myvid_mc.ns.play(video);
    _root.cover_mc.play_btn._visible = false;
}

Any help please? Thanks


If you're using FLVPlayer, have you tried doing this?

if (Math.round(flvPlayer.playheadTime) == Math.round(flvPlayer.totalTime)) {
        flvPlayer.stop();
}


From the top of my head; if you are using the FLVPlayback or any of its derived classes, it should not loop at all by default. However, you might be getting a suppressed runtime error; possibly some security sandbox violation which disrupts the proper execution of the code. In any case you might try:

player.autoRewind = true;

Where player is the name of your playback component.

0

精彩评论

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