ActionScript 3 FLVPlayBack 视频事件
如何在 FLVPlayback 启动时添加事件侦听器?如下所示:
my_player.addEventListener(VideoEvent.COMPLETE, completePlay);
my_player.addEventListener(VideoEvent.START, startPlay);
function completePlay(e:VideoEvent):void {
my_player.seek(0);
lastFrame.addChild(lastImage);
}
function startPlay(e:VideoEvent):void {
lastFrame.removeChildAt(0);
}
我想做的是在电影完成时加载静态图像,但是当用户开始播放视频时,我想删除静态图像(如果存在)。
How do you add an event listener when a FLVPlayback starts? Something like below:
my_player.addEventListener(VideoEvent.COMPLETE, completePlay);
my_player.addEventListener(VideoEvent.START, startPlay);
function completePlay(e:VideoEvent):void {
my_player.seek(0);
lastFrame.addChild(lastImage);
}
function startPlay(e:VideoEvent):void {
lastFrame.removeChildAt(0);
}
What I am trying to do is load a still image when the movie completes but when the user starts the video over I want to remove the still image if it is present.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
VideoEvent.COMPLETE
事件应该足以知道它何时结束。对于整个开始的事情,我建议以下内容:
//可能有用的其他状态:
Your
VideoEvent.COMPLETE
event should be sufficient for knowing when it ends.For the whole starting thing I would recommend the following:
//Additional states that may be useful: