11 Replies Latest reply on Apr 23, 2010 8:39 AM by bringrags

    understanding URLResource

    kutu182 Level 1

      hi,

       

      old school code, working

      ...

      nc = new NetConnection("rtmp://mysite.org")

      ...

      ns.play("mp4:video.mp4")

       

      osmf code, not playing video

      ...

      v = new VideoElement(new URLResource("rtmp://mysite.org/mp4:video.mp4"));

      ...

       

      I tested old code in FP9 and in FP10, and it worked.

       

      How i must construct url for URLResource?

       

      thx.

        • 1. Re: understanding URLResource
          RyanOConnell Level 2

          Hi -

           

          One thing looks out of place about your example is the .mp4 extension on the video.  Streams of H.264 content don't normally need the extension.  The other caveat is if the FMS server you are using has instances, you'll need to use a StreamingURLResource instead of a URLResource, and pass the urlIncludesFMSApplicationInstance as true.  A good sanity check is to test your url again the Flex VideoDisplay component, or the FLVPLayback component. 

          • 2. Re: understanding URLResource
            codingNub

            In sprint 9 I have it working like this.

             

            v = new VideoElement(new NetLoader(), new URLResource(new URL(videoURL)));
            
            • 3. Re: understanding URLResource
              codingNub Level 1

              So instead of URL it would be..

               

              v = new VideoElement(new NetLoader(), new URLResource(new FMSURL('rtmp.url'))));
              
              • 4. Re: understanding URLResource
                kutu182 Level 1

                hi codingNub,

                 

                thx, but i use sprint10, osmf 0.93, no classes URL and FMSURL.

                 

                 

                hi RyanOConnell,

                 

                still not working

                 

                <s:VideoDisplay source="rtmp://mysite.org/mp4:video.mp4"/>

                not working too

                 

                But, why so difficulty, i just want connect to "rtmp://mysite.org" and play "mp4:video.mp4"

                Can i do that instead StreamingURLResource, but continue use osmf, because it awesome?

                 

                thx

                • 5. Re: understanding URLResource
                  RyanOConnell Level 2

                  If it doesn't work with the Flex VideoDisplay class, it's most likely the wrong URL.   This can be the result of a typos or missing application.   Could you post your URL?  If not, the general format is rtmp://myserver.com/myApplication/myvideo .  Your example URL seems to be missing an application.

                  • 6. Re: understanding URLResource
                    codingNub Level 1

                    Test this in your app.

                     

                    var v:VideoElement = new VideoElement(new URLResource(REMOTE_STREAM));
                    private static const REMOTE_STREAM:String = "rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short";
                    

                     

                    That's taken directly from the examplePlayer inside trunk.

                    • 7. Re: understanding URLResource
                      bmishkin

                      Hey thanks.

                       

                      Not setting urlIncludesFMSApplicationInstance=true had been my problem for several hours today. This is the only place I have seen it mentioned.

                       

                      If you are using LimeLight's CDN to deliver mp4, you need to set urlIncludesFMSApplicationInstance=true.

                       

                      Cheers,

                      Ben Mishkin

                      Sagebit, LLC

                      • 8. Re: understanding URLResource
                        Bob Wohl Level 1

                        Hi Ben,

                         

                        Not only LimeLight uses instances. Application and application instances are

                        used quite a bit in the FMS world and the file type wouldn't have anything

                        to do with the app instance. Sounds like a uri issue or a parse issue

                        between the stream name and connection string. So you are saying that

                        setting this value to true resolves an issue with mp4s and not needed for

                        flvs?

                         

                        Thanks,

                        Bob

                        • 9. Re: understanding URLResource
                          bmishkin Level 1

                          Yes.

                           

                          We use Limelight CDN, which uses application instances. But I hadn't even noticed that we needed to set urlIncludesFMSApplicationInstance=true, because our flv URLs of the form

                           

                          rtmpe://llnwqa.fcod.llnwd.net/a1218/o18/quickstart/limelight_sample_flashmovie

                           

                          (which assumes the '.flv' extension)

                          were working without it. But when we tried an mp4, like

                           

                          rtmp://llnwqa.fcod.llnwd.net/a1218/018/mp4:path/to/test.mp4

                           

                          the video would not load until we set urlIncludesFMSApplicationInstance=true.

                          • 10. Re: understanding URLResource
                            Bob Wohl Level 1

                            Ah, that doesn't sound right being the instance has nothing to do with the

                            file type and adding the prefix. Maybe some one at adobe can confirm that

                            this is intentional and working as intended.

                             

                            Thanks for the heads up on this Ben.

                            Bob

                            • 11. Re: understanding URLResource
                              bringrags Level 4

                              Bob is right, it doesn't have anything to do with the file type or prefix.  For the first URL, it turns out that we can establish a connection with or without urlIncludesFMSApplicationInstance.  When set to false, it connects to:

                               

                              rtmpe://llnwqa.fcod.llnwd.net:1935/a1218

                               

                              When set to true, it connects to:

                               

                              rtmpe://llnwqa.fcod.llnwd.net:1935/a1218/o18

                               

                              Not sure why both URLs work, but in general you should stick with the true param for Limelight streams.