mirror of https://github.com/calzoneman/sync.git
Add streamable.com support (#585)
This commit is contained in:
parent
6aebe82298
commit
88c42af139
|
@ -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.7",
|
"version": "3.19.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,6 +15,7 @@ TYPE_MAP =
|
||||||
us: UstreamPlayer
|
us: UstreamPlayer
|
||||||
im: ImgurPlayer
|
im: ImgurPlayer
|
||||||
vm: VideoJSPlayer
|
vm: VideoJSPlayer
|
||||||
|
sb: VideoJSPlayer
|
||||||
|
|
||||||
window.loadMediaPlayer = (data) ->
|
window.loadMediaPlayer = (data) ->
|
||||||
try
|
try
|
||||||
|
|
|
@ -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.
|
||||||
|
@ -561,6 +562,20 @@ var Getters = {
|
||||||
"vm", video.meta);
|
"vm", video.meta);
|
||||||
process.nextTick(callback, false, media);
|
process.nextTick(callback, false, media);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 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);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,8 @@
|
||||||
return id;
|
return id;
|
||||||
case "hb":
|
case "hb":
|
||||||
return "http://hitbox.tv/" + id;
|
return "http://hitbox.tv/" + id;
|
||||||
|
case "sb":
|
||||||
|
return "https://streamable.com/" + id;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1273,7 +1273,8 @@
|
||||||
hb: HitboxPlayer,
|
hb: HitboxPlayer,
|
||||||
us: UstreamPlayer,
|
us: UstreamPlayer,
|
||||||
im: ImgurPlayer,
|
im: ImgurPlayer,
|
||||||
vm: VideoJSPlayer
|
vm: VideoJSPlayer,
|
||||||
|
sb: VideoJSPlayer
|
||||||
};
|
};
|
||||||
|
|
||||||
window.loadMediaPlayer = function(data) {
|
window.loadMediaPlayer = function(data) {
|
||||||
|
|
|
@ -52,6 +52,8 @@ function formatURL(data) {
|
||||||
return data.id;
|
return data.id;
|
||||||
case "hb":
|
case "hb":
|
||||||
return "http://hitbox.tv/" + data.id;
|
return "http://hitbox.tv/" + data.id;
|
||||||
|
case "sb":
|
||||||
|
return "https://streamable.com/" + data.id;
|
||||||
default:
|
default:
|
||||||
return "#";
|
return "#";
|
||||||
}
|
}
|
||||||
|
@ -1366,6 +1368,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})/))) {
|
||||||
|
|
Loading…
Reference in New Issue