闪光/ ActionScript 3的:加载的FLV文件转换为影片剪辑,并开始播放的FLV文件 [英] Flash / ActionScript 3: Load .FLV file into a MovieClip and start playing that FLV file
问题描述
我如何可以加载一个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 将是一个很好的起点。 <一href="http://as3flvplayer.cvs.sourceforge.net/viewvc/as3flvplayer/as3flvplayer/source/fPlayerEx.as?revision=1.2&view=markup"相对=nofollow>这里是类正在做的工作。这是相当简单的,但使用一个项目这样可能会节省您的时间。
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");
这篇关于闪光/ ActionScript 3的:加载的FLV文件转换为影片剪辑,并开始播放的FLV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!