From e88031f4c545ad33210149be6c514ed9adac30f8 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 2 Mar 2016 19:18:33 -0800 Subject: [PATCH] Fix rtmp->rtmp transition --- player/rtmp.coffee | 10 ++++++++-- www/js/callbacks.js | 2 +- www/js/player.js | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/player/rtmp.coffee b/player/rtmp.coffee index ab3b6f96..e36232ce 100644 --- a/player/rtmp.coffee +++ b/player/rtmp.coffee @@ -7,6 +7,14 @@ window.RTMPPlayer = class RTMPPlayer extends VideoJSPlayer if not (this instanceof RTMPPlayer) return new RTMPPlayer(data) + @setupMeta(data) + super(data) + + load: (data) -> + @setupMeta(data) + super(data) + + setupMeta: (data) -> data.meta.direct = # Quality is required for data.meta.direct processing but doesn't # matter here because it's dictated by the stream. Arbitrarily @@ -16,5 +24,3 @@ window.RTMPPlayer = class RTMPPlayer extends VideoJSPlayer link: data.id } ] - - super(data) diff --git a/www/js/callbacks.js b/www/js/callbacks.js index 0956ca41..aee55e5e 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -1079,7 +1079,7 @@ Callbacks = { } } -var SOCKET_DEBUG = false; +var SOCKET_DEBUG = localStorage.getItem('cytube_socket_debug') === 'true'; setupCallbacks = function() { for(var key in Callbacks) { (function(key) { diff --git a/www/js/player.js b/www/js/player.js index 4cb83e5a..c2ade742 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -1007,15 +1007,24 @@ if (!(this instanceof RTMPPlayer)) { return new RTMPPlayer(data); } - data.meta.direct = { + this.setupMeta(data); + RTMPPlayer.__super__.constructor.call(this, data); + } + + RTMPPlayer.prototype.load = function(data) { + this.setupMeta(data); + return RTMPPlayer.__super__.load.call(this, data); + }; + + RTMPPlayer.prototype.setupMeta = function(data) { + return data.meta.direct = { 480: [ { link: data.id } ] }; - RTMPPlayer.__super__.constructor.call(this, data); - } + }; return RTMPPlayer;