FLVPlayBack:在出现提示之前不要加载 flv

发布于 2024-08-07 17:05:38 字数 161 浏览 0 评论 0原文

是否可以配置 FLVPlayback,使其不自动加载关联的视频文件,而是等待单击“播放”按钮来加载然后播放? (我正在构建一个网站,该网站将在其首页上提供一个相当大的视频的播放器,并且我宁愿不下载视频,除非/直到用户要求查看它。)我已经将自动播放设置为 false ,但我仍然可以在进度栏中看到视频正在下载。

Is it possible to configure FLVPlayback so that it does not auto-load the associated video file, but instead waits for a click on a "play" button to load and then play it? (I'm building a site that will have a player for a rather large video on its front page, and I'd rather not have the video downloaded unless/until the user asks to see it.) I already have autoplay set to false, but I can still see the video getting downloaded in the progress bar.

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

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

发布评论

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

评论(2

蝶舞 2024-08-14 17:05:38

将 FLVPlayback 的源留空。仅当用户要求观看视频时才设置源。

Leave the source of the FLVPlayback blank. Set the source only when the user asks to see the video.

我不会写诗 2024-08-14 17:05:38

添加一个不可见的按钮,其点击区域与视频一样大:

btnPlay.addEventListener(MouseEvent.CLICK, onPlayClick);

function onPlayClick(evt:MouseEvent):void
{
btnPlay.visible = false;
flvPlayer.load("filename.flv");
flvPlayer.play();
}

或者类似的东西。问题是:当没有分配内容时,FLVPlayback 组件会显示一个带有条纹的动画栏。如果您不想看到它,可以将“skinAutoHide”属性设置为 true。之后,只剩下一个问题:用户看不到您的播放器,因此您应该在按钮中添加播放图像。如果单击该按钮,该按钮就会消失并且视频开始加载和播放。

add an invisible button, with a hit area as big as the video:

btnPlay.addEventListener(MouseEvent.CLICK, onPlayClick);

function onPlayClick(evt:MouseEvent):void
{
btnPlay.visible = false;
flvPlayer.load("filename.flv");
flvPlayer.play();
}

or something like that. the problem is: the FLVPlayback component shows an animated bar with stripes when there is no content assigned to it. if you don´t want to see that, you could set the "skinAutoHide" property to true. after that, there is only one more problem: the user doesn´t see your player, so you should add a play image in the button. if you click on the button, the button disappears and the video starts loading and playing.

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