Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Added FCSubscribe and proxy support #208

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified dist/video-js.swf
Binary file not shown.
4 changes: 3 additions & 1 deletion src/com/videojs/providers/RTMPVideoProvider.as
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ package com.videojs.providers{
private function initNetConnection():void{
if(_nc == null){
_nc = new NetConnection();
_nc.proxyType = 'best'; // needed behind firewalls
_nc.client = this;
_nc.addEventListener(NetStatusEvent.NET_STATUS, onNetConnectionStatus);
}
Expand Down Expand Up @@ -463,6 +464,7 @@ package com.videojs.providers{
switch(e.info.code){
case "NetConnection.Connect.Success":
_model.broadcastEventExternally(ExternalEventName.ON_RTMP_CONNECT_SUCCESS);
_nc.call("FCSubscribe", null, _src.streamURL); // try to subscribe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this cause any issues for normal playback like for mp4s?

Copy link
Author

@albertogasparin albertogasparin Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it with node-rtsp-rtmp-server, as it does not support FCSubscribe. VOD videos play fine: as the streaming server reports "unknown command" the swf code ignores it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can second this. On-demand videos play fine when using the updated SWF.

initNetStream();
break;
case "NetConnection.Connect.Failed":
Expand Down Expand Up @@ -639,7 +641,7 @@ package com.videojs.providers{
* Called from FMS when subscribing to live streams.
*/
public function onFCSubscribe(pInfo:Object):void {
// no op for now but needed by NetConnection
initNetStream();
}

/**
Expand Down