FLVplayback - 停止文件自动下载
目前,我的舞台上有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在设置源属性之前,视频不会开始加载,因此,当您希望它启动时,只需用代码设置它
即可。 只要您以后不想再次使用该 FLVPlayback,sims281 的答案就可以工作,因为他的方法可以工作,但会让玩家陷入困境。 我不久前做了一个课程,它确实有效地停止了视频流,但仍然允许您继续使用该播放器,您可以在这里看到它:
FLVPlaybackUtils
使用该类,您可以执行以下操作:
它将清除播放器,停止任何流式传输或下载,并将播放器重置为再次可用,以防万一您稍后想在程序中再次使用它。
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:
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.
不确定第一部分,但这与您想要的类似吗?
Not sure on the first part but is this something similar to what you're after?