8 Replies Latest reply on Aug 17, 2010 1:13 AM by Andrian Cucu

    Unable to play a file on cloudfront

    David G. Leal

      Hi everyone,

       

      For the life of me, I can't play a file hosted on cloudfront through the OSMF player. After a million google searches and some source browsing, I came to the following line:

       

      mediaFactory.createMediaElement(new StreamingURLResource(new FMSURL(url, true), StreamType.RECORDED));

       

      which gets me to a NetStream.Play.StreamNotFound.

       

      The same url plays fine using JW Player or flvstreamer.

       

      Can anyone help me with this?

       

      Thanks,

       

      David

        • 1. Re: Unable to play a file on cloudfront
          David G. Leal Level 1

          Uh, it turns out we can't send the file extension in the url you send to the cloudfront servers. It's simple as that. *blushes*

          • 2. Re: Unable to play a file on cloudfront
            ykessler

            We are also unable to stream cloudfront videos into the osmf-based Flex VideoPlayer ( As of build 4.0.0.13619 ). Can you explain exactly what you did to solve this? 

            • 3. Re: Unable to play a file on cloudfront
              David G. Leal Level 1

              There are 2 things you need to do:

               

              • You need to use the FMSURL class instead of the usual URL one. I tried using _definst_ in the url, but that didn't work for me.
              • You need to omit the file extension from the url you pass to cloudfront.

               

              So, something like this:

               

              mediaFactory.createMediaElement(new URLResource(new FMSURL("rtmp://<cloudfront_host>/cfx/st/path/to/media", true)));

               

              HTH,

               

              David

              • 4. Re: Unable to play a file on cloudfront
                ykessler Level 1

                Huge!  Thanks David, works like a charm-

                My follow up question for you is how would you get MP4s streaming?  We used to distinguish our flvs/mp4s by the urls:

                 

                rtmp://<cloudfront_host>/cfx/st/path/to/video.flv

                rtmp://<cloudfront_host>/cfx/st/path/to/mp4:video.mp4

                 

                Just stripping the mp4 extension off the second url didn't seem to work.

                Thoughts?

                • 5. Re: Unable to play a file on cloudfront
                  David G. Leal Level 1

                  Yup, the correct url is rtmp://<cloudfront-host>/cfx/st/mp4:path/to/mp4/file.

                  • 6. Re: Unable to play a file on cloudfront
                    ykessler Level 1

                    Did I mention you're the man?

                    • 7. Re: Unable to play a file on cloudfront
                      fabiogore

                      Hello,

                       

                      This is what i need, but where i put the:

                       

                      mediaFactory.createMediaElement(new URLResource(new FMSURL("rtmp://<cloudfront_host>/cfx/st/path/to/media", true)));

                       

                      ??

                       

                      I´m trying but the player don´t apear, with this code:

                       

                                     mediaFactory.createMediaElement(new URLResource(new FMSURL("rtmp://s26w4pctht0dxp.cloudfront.net/cfx/st/path/to/mysuite_institucional", true)));

                                     

                                    var parameters =

                                         {     id: "1"

                                         ,     src: "rtmp://s26w4pctht0dxp.cloudfront.net/cfx/st/path/to/mysuite_institucional"

                                         ,     autoPlay: "true"

                                         ,   width: "638"

                                         ,   height: "400"

                                          ,     autoHideControlBar: "false"

                                          ,     controlBarPosition: "bottom"

                                          

                                         };

                                          

                                          

                                                  

                                    // Embed the player SWF:

                                    

                                    swfobject.embedSWF

                                          ( "StrobeMediaPlayback.swf"

                                          , "player"

                                          , parameters["width"], parameters["height"]

                                          , "10.1.0"

                                          , {}

                                          , parameters

                                          , { allowFullScreen: "true" }

                                          , { name: "StrobeMediaPlayback" }

                                          );

                       

                      Can you help me?

                      • 8. Re: Unable to play a file on cloudfront
                        Andrian Cucu Adobe Employee

                        Hi Fabioqore,

                         

                        This thread should help you:

                        http://forums.adobe.com/thread/688005

                         

                        Please use the Strobe Media Playback forum for questions related to Strobe Media Playback. I missed this thread earlier. So, sorry for answering this so late.

                         

                        -Andrian