如何加載並在Flash播放.avi或.mpg4?那可能嗎 ?閃光燈是否播放.avi或.mpg4?如果是,如何?
- >這個類可以播放FLV的,也.MP4 ..但對於.AVI它顯示錯誤 「錯誤#2044:未處理的NetStatusEvent :.水平=錯誤,代碼= NetStream.Play.StreamNotFound」
package src {
import flash.display.Sprite;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.Event;
import flash.events.MouseEvent;
public class vplayer extends Sprite{
public var vid:Video = new Video(1920,1080);
private var nc:NetConnection = new NetConnection();
public var ns:NetStream;
public var listener:Object = new Object();
private var _duration:Number = 0;
public function vplayer():void{
addChild(vid);
nc.connect(null);
ns = new NetStream(nc);
vid.attachNetStream(ns);
listener.onMetaData = metaDataHandler;
ns.client = listener;
//customClient.onCuePoint = cuePointHandler;
}
public function playVideo00(vv:String):void{
ns.play(vv);
}
public function stopVideo00():void{
ns.close();
}
/*public function cuePointHandler(infoObject:Object):void {
trace("cuePoint");
}*/
public function metaDataHandler(infoObject:Object):void {
_duration = infoObject["duration"];
trace (" Time: " + infoObject["duration"]);
}
public function get duration00():Number {
return _duration;
}
}
}
..任何幫助嗎?
Thanks .. that works,but not for.avi .. – 2011-06-03 01:52:43