停止 flv 循环

发布于 2024-10-03 13:48:01 字数 564 浏览 2 评论 0原文

我有一个视频播放器 swf,它通过 flashvars 加载 flv 文件。这工作得很好,但是当它到达结尾时它会循环,即返回开始并再次播放。仅当它嵌入到页面中时才会发生这种情况,因为当我按 cntl+Enter 单独预览 swf 时它会起作用。

它是通过 netstream 加载的。这是最后一段代码...

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;
}

请问有什么帮助吗? 谢谢

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 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事灯 2024-10-10 13:48:01

如果您使用 FLVPlayer,您尝试过这样做吗?

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

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

if (Math.round(flvPlayer.playheadTime) == Math.round(flvPlayer.totalTime)) {
        flvPlayer.stop();
}
最后的乘客 2024-10-10 13:48:01

从我的头顶;如果您使用 FLVPlayback 或其任何派生类,则默认情况下它根本不应该循环。但是,您可能会收到抑制的运行时错误;可能存在一些安全沙箱违规,从而破坏了代码的正确执行。在任何情况下,您都可以尝试:

player.autoRewind = true;

其中 player 是播放组件的名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文