[英]FLV Cue point on video Import
I'm having trouble with a simple AS3 (CS5.5) project I have imported a video encoded through Adobe media encoder as a FLV file and have added a Navigation Cue Point at the end of the video as I would like the video to simply go to a frame number when the video has ended so it doesn't stop on that video. 我在一个简单的AS3(CS5.5)项目中遇到了麻烦,我已将通过Adobe媒体编码器编码的视频导入为FLV文件,并在视频末尾添加了一个导航提示点,因为我希望该视频可以简单地视频播放结束后转到帧号,这样就不会在该视频上停止播放。
I have used a code I have used on many occasions in AS2 which I put on a keyframe at the top where the video runs under and give the video an instance name of vid: 我使用了我在AS2中多次使用的代码,该代码放在视频运行所在的顶部的关键帧上,并为视频指定实例名称vid:
stop();
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
// Put any code you like here<br>
trace("Cue point name: " + eventObject.info.name);
trace("Cue point type: " + eventObject.info.type);
if(eventObject.info.name=="movieend")
{
gotoAndPlay(135);
}
}
vid.addEventListener("cuePoint", listenerObject);
For some reason this is coming up with an error in AS3. 由于某些原因,这会导致AS3中出现错误。
Ideally I just want the code go to a frame number when the video finishes instead of staying on the video. 理想情况下,我只希望代码在视频播放结束时转到帧号,而不是停留在视频上。
Your code seems to be a little out of whack. 您的代码似乎有点不合时宜。 Try this. 尝试这个。
stop();
vid.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
function cp_listener(eventObject:MetadataEvent):void {
trace("Cue point name: " + eventObject.info.name);
trace("Cue point type: " + eventObject.info.type);
if (eventObject.info.name == "movieend") {
//flvPlaybak.seek(0);
//flvPlaybak.play();
gotoAndPlay(135);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.