FLVplayback - 停止文件自动下载

发布于 2024-07-15 09:10:13 字数 143 浏览 4 评论 0原文

目前,我的舞台上有 FLVplayback 组件,但是我将 autoPlay 设置为 False。 这是一个问题,因为我希望流仅在用户按下播放时才开始下载。

另外,当我点击离开视频打开的页面时,我希望能够停止下载流。

提前致谢。

I currently have the FLVplayback component on my stage, however, I have the autoPlay set to False. This is a problem because I want the stream to only start downloading when the user presses play.

Also, I would like to be able to stop the stream from downloading when I click away from the page with the video on.

Thanks in advance.

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

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

发布评论

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

评论(2

标点 2024-07-22 09:10:13

在设置源属性之前,视频不会开始加载,因此,当您希望它启动时,只需用代码设置它

即可。 只要您以后不想再次使用该 FLVPlayback,sims281 的答案就可以工作,因为他的方法可以工作,但会让玩家陷入困境。 我不久前做了一个课程,它确实有效地停止了视频流,但仍然允许您继续使用该播放器,您可以在这里看到它:

FLVPlaybackUtils

使用该类,您可以执行以下操作:

import FLVPlaybackUtils;

FLVPlaybackUtils.reset(myFlvPlayback);

它将清除播放器,停止任何流式传输或下载,并将播放器重置为再次可用,以防万一您稍后想在程序中再次使用它。

The video won't start loading until you set the source property, so just set it with code when you want it to start

sims281's answer works as long as you don't want to use that FLVPlayback again later, since his method will work, but will mess up the player. I made a class a while back that does stop the video stream effectively and still allows you to continue using that player though, you can see it here:

FLVPlaybackUtils

Using that class you can just do this:

import FLVPlaybackUtils;

FLVPlaybackUtils.reset(myFlvPlayback);

It will clear the player, stop any streaming or downloading, and reset the player to be usable again, just in case you want to use it again later in the program.

番薯 2024-07-22 09:10:13

不确定第一部分,但这与您想要的类似吗?

if (FLVplayerInstanceName)
 {
  FLVplayerInstanceName.stop();  
  FLVplayerInstanceName.getVideoPlayer(FLVplayer.activeVideoPlayerIndex).close();
  gotoAndStop("yourPageLabel");
 }

Not sure on the first part but is this something similar to what you're after?

if (FLVplayerInstanceName)
 {
  FLVplayerInstanceName.stop();  
  FLVplayerInstanceName.getVideoPlayer(FLVplayer.activeVideoPlayerIndex).close();
  gotoAndStop("yourPageLabel");
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文