diff --git a/lib/database/channels.js b/lib/database/channels.js index dd68f083..13b7c80a 100644 --- a/lib/database/channels.js +++ b/lib/database/channels.js @@ -426,7 +426,8 @@ module.exports = { var meta = JSON.stringify({ bitrate: media.meta.bitrate, - codec: media.meta.codec + codec: media.meta.codec, + gpdirect: media.meta.gpdirect }); db.query("INSERT INTO `channel_libraries` " + diff --git a/lib/get-info.js b/lib/get-info.js index c204cfae..0cbf233f 100644 --- a/lib/get-info.js +++ b/lib/get-info.js @@ -892,7 +892,7 @@ var Getters = { } } - var media = new Media(id, title, duration, "gp", { direct: direct }); + var media = new Media(id, title, duration, "gp", { gpdirect: direct }); cb(null, media); }); } diff --git a/lib/media.js b/lib/media.js index 7cfcda81..4da128ad 100644 --- a/lib/media.js +++ b/lib/media.js @@ -35,6 +35,7 @@ Media.prototype = { object: this.meta.object, params: this.meta.params, direct: this.meta.direct, + gpdirect: this.meta.gpdirect, restricted: this.meta.restricted, codec: this.meta.codec, bitrate: this.meta.bitrate diff --git a/www/js/player.js b/www/js/player.js index b40d28dc..8752d614 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -1082,6 +1082,9 @@ function FilePlayer(data) { self.initFlash = function (data) { waitUntilDefined(window, "swfobject", function () { + if (!data.url) { + return; + } self.volume = VOLUME; self.videoId = data.id; self.videoURL = data.url; @@ -1161,6 +1164,9 @@ function FilePlayer(data) { }; self.init = function (data) { + if (!data.url) { + return; + } self.videoId = data.id; self.videoURL = data.url; var isAudio = data.meta.codec && data.meta.codec.match(/^mp3$|^vorbis$/); diff --git a/www/js/util.js b/www/js/util.js index ae0826d7..cd352a20 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2742,6 +2742,11 @@ function googlePlusSimulator2014(data) { data.forceFlash = true; } + if (!data.meta.gpdirect) { + data.url = ""; + return data; + } + /* Convert youtube-style quality key to vimeo workaround quality */ var q = USEROPTS.default_quality || "auto"; @@ -2752,13 +2757,13 @@ function googlePlusSimulator2014(data) { i = fallbacks.indexOf("medium"); } - while (!(q in data.meta.direct) && i < fallbacks.length) { + while (!(q in data.meta.gpdirect) && i < fallbacks.length) { q = fallbacks[i++]; } if (i === fallbacks.length) { q = "medium"; } - data.url = data.meta.direct[q]; + data.url = data.meta.gpdirect[q]; return data; }