3 Replies Latest reply on May 20, 2015 11:32 PM by Win 8.1 debugger | Adobe

    RTMP Adaptive Switching Issue

    Win 8.1 debugger | Adobe Level 1

      Hello Sir.

      I have create a flash player using osmf plugin and smilplugin code which i found (fromhttps://getstreaming.wordpress.com/2011/05/27/dynamic-streaming-test-drive/#comment-349).


      I have an issue while playing  SMIL  file in my "custom player" through wowza media server.

      The issue is adaptive switching doesn't work in my custom player  in case of RTMP protocol, but my custom player play following smil url with adaptive switching and manual switching (@ !http://mediapm.edgesuite.net/ovp/content/demo/smil/elephants_dream.smil ).


      and also play  HDS and HSL Streaming through wowza media server.

      I appreciate your help.



      sample smil file which i am using for Wowza mentioned below


      <?xml version="1.0" encoding="UTF-8"?>



        <meta base="rtmp://"/>




             <video src='mp4:main360.mp4' system-bitrate='200000' />

             <video src='mp4:main720.mp4' system-bitrate='480000' />

             <video src='mp4:sample.mp4' system-bitrate='720000' />




        • 1. Re: RTMP Adaptive Switching Issue
          Sunil Kumar Sah Level 1



          Please use below methods for playing  RTMP SMIL -



          private var dynResource:DynamicStreamingResource;

          private var tracingNetLoader:TracingNetLoader;

          private var element :VideoElement;



          private function createSMILObj(str:String):void {

            try {

            var objSMIL:Object = createSMILObj(str); // Function give below

            var obj:Object = objSMIL["files"];

            var fileLen:Number = getObjLen(obj); // function given below

            dynResource = new DynamicStreamingResource(String(objSMIL["baseURL"]));

            vector = new Vector.<DynamicStreamingItem > (fileLen);

            for (var i:int=0; i<fileLen; i++) {

            vector[i] = new DynamicStreamingItem(obj[i].src,obj[i].bitrates,obj[i].width);


            dynResource.streamItems = vector;

            tracingNetLoader = new TracingNetLoader();

            element = new VideoElement(dynResource,tracingNetLoader);

            //initPlayer(element);  // Pass this element in OSMF Object and play video.

          }catch (error:Error) {

            //trace("Error found in loading SMIL XML")






          public static function createSMILObj(_str:String):Object {

            var baseUrl:String;

            var smilXML:XML;

            var videoList:XMLList;

            var mainObj:Object = new Object();

            var fileObj:Object = new Object();

            var str:String;

            var tempArray:Array=_str.split("<head>");

            var tempStr:String = String("<smil><head>"+tempArray[1]);




            smilXML=new XML(str);


            //trace("base = "+baseUrl);



            for (var i:int = 0; i<videoList.length(); i++) {

            fileObj[i]={src:videoList[i].@src,bitrates:videoList[i].@systembitrate,width:videoList[i] .@width};



            trace("Error found in updating SMIL XML File.....")




            return mainObj;





          public function getObjLength(obj:Object):Number {

            var counts:Number=0;

            for (var id in obj) {



            return counts;




          Best regards,

          Sunil Kumar

          • 2. Re: RTMP Adaptive Switching Issue
            Win 8.1 debugger | Adobe Level 1

            Thanks Sunil,


            it work fine on local wowza for vod but at live stream it does fluctuate frequently between streams.it does not work at my end for public url like




            when i debug this i found DynamicStreamEvent.SWITCHING_CHANGE event is not trigger in case of public url.

            please help me.



            Shivam Gupta@

            • 3. Re: RTMP Adaptive Switching Issue
              Win 8.1 debugger | Adobe Level 1

              Can anybody tell me how to resolve above issue.If anybody has other way to play smil file with adaptive switching so please give your ideas.