1 Reply Latest reply on Oct 20, 2011 4:14 PM by David_RealEyes

    re-encoding to osmf

    keane_ms

      hi all,

       

      please help me, now i'm re-encoding media player from normally actionscript 3 to using framework OSMF 1.6. but i don't know where to start? because the media address using rtmpt protocol, this in the code to re-encoding:

       

      import flash.events.NetStatusEvent;

                                    import flash.net.NetConnection;

                                    import flash.net.NetStream;

       

                                    import mx.controls.Alert;

       

       

       

                                    private const RTMP:String = "rtmp://stream.imortalnow.com:80/audio?RINGID=0104FTD11000625&TRXTYPE=61&SENDERID=bLu3W4t e12&USERID=123456&filename=0104FTD11000625.mp4";

       

       

       

                                    private var _nc:NetConnection;

                                    private var _loader:NetLoader;

       

       

       

                                    private function init():void{

                                              _nc=new NetConnection();

                                              _nc.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);

                                              _nc.connect(RTMP);

       

       

                                    }

       

                                    private function netStatusHandler(e:NetStatusEvent):void{

                                              trace(e.info.code);

       

                                              switch(e.info.code)

                                              {

                                                        case "NetConnection.Connect.Success":

                                                        {

                                                                  trace("Connect Success");

                                                                  playStream();

                                                                  break;

                                                        }

       

                                                        case "NetStream.Play.StreamNotFound":

                                                        {

                                                                  trace("Connect Failed");

                                                                  break;

                                                        }

       

                                              }

                                    }

       

       

       

                                    private function playStream():void{

                                              trace("playStream");

                                              var stream:NetStream = new NetStream(_nc);

                                              var video:Video=new Video();

                                              stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

                                              //stream.client = new CustomClient();

                                              video.attachNetStream(stream);

                                              stream.client=new CustomClient();

                                              stream.play("mp4:0104FTD11000625.mp4");

                                              playerContainer.addChild(video);

                                    }

       

       

      Thanks for all.