Merge branch '3.0' into videojs-hls

This commit is contained in:
calzoneman 2016-08-09 22:41:55 -07:00
commit e99bfcd47b
6 changed files with 34 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.18.8", "version": "3.19.0",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -16,6 +16,7 @@ TYPE_MAP =
im: ImgurPlayer im: ImgurPlayer
vm: VideoJSPlayer vm: VideoJSPlayer
hl: HLSPlayer hl: HLSPlayer
sb: VideoJSPlayer
window.loadMediaPlayer = (data) -> window.loadMediaPlayer = (data) ->
try try

View File

@ -11,6 +11,7 @@ var mediaquery = require("cytube-mediaquery");
var YouTube = require("cytube-mediaquery/lib/provider/youtube"); var YouTube = require("cytube-mediaquery/lib/provider/youtube");
var Vimeo = require("cytube-mediaquery/lib/provider/vimeo"); var Vimeo = require("cytube-mediaquery/lib/provider/vimeo");
var Vidme = require("cytube-mediaquery/lib/provider/vidme"); var Vidme = require("cytube-mediaquery/lib/provider/vidme");
var Streamable = require("cytube-mediaquery/lib/provider/streamable");
/* /*
* Preference map of quality => youtube formats. * Preference map of quality => youtube formats.
@ -567,6 +568,24 @@ var Getters = {
const media = new Media(video.id, video.title, video.duration, const media = new Media(video.id, video.title, video.duration,
"vm", video.meta); "vm", video.meta);
process.nextTick(callback, false, media); process.nextTick(callback, false, media);
}).catch(function (err) {
callback(err.message || err, null);
});
},
/* streamable */
sb: function (id, callback) {
if (!/^[\w-]+$/.test(id)) {
process.nextTick(callback, "Invalid streamable.com ID");
return;
}
Streamable.lookup(id).then(video => {
const media = new Media(video.id, video.title, video.duration,
"sb", video.meta);
process.nextTick(callback, false, media);
}).catch(function (err) {
callback(err.message || err, null);
}); });
} }
}; };

View File

@ -244,6 +244,8 @@
return "http://hitbox.tv/" + id; return "http://hitbox.tv/" + id;
case "hl": case "hl":
return id; return id;
case "sb":
return "https://streamable.com/" + id;
default: default:
return ""; return "";
} }

View File

@ -1305,7 +1305,8 @@
us: UstreamPlayer, us: UstreamPlayer,
im: ImgurPlayer, im: ImgurPlayer,
vm: VideoJSPlayer, vm: VideoJSPlayer,
hl: HLSPlayer hl: HLSPlayer,
sb: VideoJSPlayer
}; };
window.loadMediaPlayer = function(data) { window.loadMediaPlayer = function(data) {

View File

@ -54,6 +54,8 @@ function formatURL(data) {
return "http://hitbox.tv/" + data.id; return "http://hitbox.tv/" + data.id;
case "hl": case "hl":
return data.id; return data.id;
case "sb":
return "https://streamable.com/" + data.id;
default: default:
return "#"; return "#";
} }
@ -1375,6 +1377,13 @@ function parseMediaLink(url) {
}; };
} }
if((m = url.match(/streamable\.com\/([\w-]+)/))) {
return {
id: m[1],
type: "sb"
};
}
/* Shorthand URIs */ /* Shorthand URIs */
// To catch Google Plus by ID alone // To catch Google Plus by ID alone
if ((m = url.match(/^(?:gp:)?(\d{21}_\d{19}_\d{19})/))) { if ((m = url.match(/^(?:gp:)?(\d{21}_\d{19}_\d{19})/))) {