hello greg h
Sorry to bother you again . I met the problem that I couldn't play flv
file streaming from FMS server in browser. here is my codes:
var nc:NetConnection ;
         public function connection():void{
             if (Connect_btn.label == "Connect" ){
                 nc = new NetConnection();
                    nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
                  nc.addEventListener(NetStatusEvent.NET_STATUS,
ncStatusHandler);
                  nc.connect("rtmp:/videodisplay");
                 Connect_btn.label = "DisConnection";
             }else{
                 nc.close();
             }
         }
         private function ncStatusHandler(event:NetStatusEvent):void{
             var status :String = event.info.code;
             switch (status) {
                 case "NetConnection.Connect.Success":
                       connectStream();
                     break;
             }
         }
           private function netStatusHandler(event:NetStatusEvent):void {
             var status :String = event.info.code;
             switch (status) {
                 case "NetStream.Play.StreamNotFound":
                     result.text = "Stream not found: ";
                     break;
                 case "NetStream.Play.Reset":
                     result.text = "play reset ";
                     break ;
                 case "NetStream.Play.Start":
                     result.text = "playing";
                     break;

             }
         }
          private function connectStream():void {
                 var stream:NetStream = new NetStream(nc);
                 stream.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
                 var client:Object = new Object( );
                 client.onMetaData = function(metadata:Object):void {
                     trace(metadata.duration);
                 };
                 stream.client = client;
                 stream.play("phone.flv");
                 var video:Video = new Video();
                 video.height = 120;
                 video.width = 200;
                 video.attachNetStream(stream);
                 canvas.addChild(video);
         }
                I placed  phone.flv file in applications/videodisplay
directory .When I debug this application , these codes caught all cases
decleared in ncStatusHandler and netStatusHandler function .However ,
the surprisingthing is phone.flv couldn't be played .I saw phone.flv was
loaded in "View application " tab of admin panel ,and type  ,status of
phone.flv was  respectively "Live" ,"Viewing".I totally confused where
was wrong ?????
                        Thanks in advance.


Reply via email to