2
votes

Does anyone know if there is an option to tell Video.js to subscribe to a live rtmp stream? There is an option for this in flowplayer and jwplayer. I'm using Edgecast for a CDN and they require this option.

from flowplayer subscribe:

Set to true to make the plugin 'subscribe' to the stream. Needed for RTMP live streams from Akamai, Limelight and other CDNs which may require the FCSubscribe command.

If I use jwplayer on the same computer to play the stream, Video.js starts to play. When I stop the jwplayer the Video.js player stops.

Thanks Austin

1
Did you find a solution? I have the same problem.Y3mSHF

1 Answers

0
votes

I compiled video-js-swf manually and modified the RTMPVideoProvider implementation to call FCSubscribe during the NetStream initialization.

_nc.call("FCSubscribe", null, _src.streamURL);

Simply requesting the live stream from EdgeCast, Akamai and other CDN is not sufficient. We must tell the edge server (the CDN node) to subscribe and pull the stream from its origin.

Then I implemented onFCSubscribe that was a #NOOP to start the stream

public function onFCSubscribe(pInfo:Object):void {
  if (pInfo.code == "NetStream.Play.Start") {
    _ns.play(_src.streamURL);
    _videoReference.attachNetStream(_ns);
  }
}