闪光/ ActionScript 3的:加载的FLV文件转换为影片剪辑,并开始播放的FLV文件文件、转换为、闪光、影片剪辑

2023-09-08 12:27:00 作者:你一枪崩了我说是枪走火۞

我如何可以加载一个FLV文件转换成影片剪辑(可以调用实例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");

从这里