如何在 Flash 中加载和播放 .avi 或 .mpg4?那可能吗 ?
-> 此类可以播放 .flv 和 .mp4 .. 但对于 .avi 会显示错误“错误 #2044: Unhandled NetStatusEvent:.level=error, code=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;
}
}
}
..有什么帮助吗?