视频导入上的 FLV 提示点

发布于 2025-01-08 06:20:19 字数 689 浏览 0 评论 0原文

我在处理一个简单的 AS3 (CS5.5) 项目时遇到问题 我已导入通过 Adob​​e 媒体编码器编码的视频作为 FLV 文件,并在视频末尾添加了一个导航提示点,因为我希望视频能够简单地显示视频结束时转到帧号,这样视频就不会停止在该视频上。

我使用了在 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); 

由于某种原因,这在 AS3 中出现了错误。

理想情况下,我只希望代码在视频结束时转到帧号,而不是停留在视频上。

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.

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:

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.

Ideally I just want the code go to a frame number when the video finishes instead of staying on the video.

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

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

发布评论

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

评论(1

染柒℉ 2025-01-15 06:20:19

你的代码似乎有点不正常。试试这个。

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);
       }

}

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);
       }

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