Flash/ActionScript 3:将 .FLV 文件加载到 MovieClip 中并开始播放该 FLV 文件 [英] Flash / ActionScript 3: Load .FLV file into a MovieClip and start playing that FLV file

查看:22
本文介绍了Flash/ActionScript 3:将 .FLV 文件加载到 MovieClip 中并开始播放该 FLV 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 FLV 文件加载到 MovieClip(让我们将实例称为flvPlaceHolder")并开始播放该 FLV 文件..使用 ActionScript 3?

How can I load a FLV file into a MovieClip (lets call the instance "flvPlaceHolder") and start playing that FLV file.. using ActionScript 3?

推荐答案

没有明确回答您的问题,但是有许多开源 FLV 播放器.我会通过抓住其中一个并查看它们如何处理播放视频来解决这个问题.

Not explicitly answering your question, but there are a number of open source FLV players in the wild. I'd approach the problem by grabbing one of those and seeing how they handle playing video.

FPlayer 将是一个很好的起点.这里是课程 正在做的工作.这是相当直接的,但使用这样的项目可能会为您节省一些时间.

FPlayer would be an excellent starting point. Here is the class that is doing the work. It is fairly straight forward, but using a project like this would probably save you some time.

这个片段应该以一种非常简单的方式来解决问题:

This snippet should do the trick in an extremely bare bones fashion:

var vid:Video = new Video(320, 240);
addChild(vid);

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
vid.attachNetStream(ns);

var listener:Object = new Object();
listener.onMetaData = function(evt:Object):void {};
ns.client = listener;

ns.play("externalVideo.flv");

从这里

这篇关于Flash/ActionScript 3:将 .FLV 文件加载到 MovieClip 中并开始播放该 FLV 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆