0 Replies Latest reply on May 6, 2010 11:03 AM by bringrags

    What to do when you get a StreamNotFound error for RTMP

    bringrags Level 4

      One of the problems that often comes up when integrating with a CDN is that some CDNs expect the FMS application instance name to be included in the URL, and others don't.  There's no way to inspect an RTMP URL and determine which approach a CDN uses, you really need to know this information when constructing the URL.  If you get it wrong, then you'll get a StreamNotFound error.  Two CDNs in particular that expect this parameter to be set to true are Limelight and EdgeCast (though there may be more).

       

      OSMF attempts to solve this by allowing the client to specify the CDN's approach (via StreamingURLResource.urlIncludesFMSApplicationInstance). So if you're getting a StreamNotFound error, try setting this param to true.  We've gotten numerous questions about specific streams failing, and  often the case is that the client didn't realize that their CDN requires  this parameter to be set to true.

       

      (The rest of this post describes a way that CDNs can make this work even if the client doesn't set the param to true.)

       

      However, there is a way that the CDN, via its plugin, can ensure that the client will never get it wrong.  The gist of the solution is that the CDN plugin can force this parameter to be true.  I've posted an example of how to do this

      here.  The posted class is a subclass of ProxyElement.  To use it, the CDN plugin would include this class and return it as the wrapper for the MediaElement that they would normally return.  For example, if a MediaFactoryItem in the plugin has the following function for its mediaElementCreationFunction:

       

      private function createVideoElement():MediaElement
      {
           return new VideoElement();
      }

       

      then they could change it to this:

       

      private function createVideoElement():MediaElement
      {
            return new UseInstanceProxyElement(new VideoElement());
      }

       

      Doing so will ensure that the parameter is always set to true, even if the client didn't set it.