Add twitch clip support (#659)
This commit is contained in:
parent
995ab142e3
commit
e9c519c6e2
6 changed files with 36 additions and 1 deletions
|
|
@ -1519,7 +1519,8 @@
|
|||
im: ImgurPlayer,
|
||||
vm: VideoJSPlayer,
|
||||
hl: HLSPlayer,
|
||||
sb: VideoJSPlayer
|
||||
sb: VideoJSPlayer,
|
||||
tc: VideoJSPlayer
|
||||
};
|
||||
|
||||
window.loadMediaPlayer = function(data) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ function formatURL(data) {
|
|||
return data.id;
|
||||
case "sb":
|
||||
return "https://streamable.com/" + data.id;
|
||||
case "tc":
|
||||
return "https://clips.twitch.tv/" + data.id;
|
||||
default:
|
||||
return "#";
|
||||
}
|
||||
|
|
@ -1284,6 +1286,13 @@ function parseMediaLink(url) {
|
|||
};
|
||||
}
|
||||
|
||||
if ((m = url.match(/clips\.twitch\.tv\/([A-Za-z]+)/))) {
|
||||
return {
|
||||
id: m[1],
|
||||
type: "tc"
|
||||
};
|
||||
}
|
||||
|
||||
if((m = url.match(/twitch\.tv\/(?:.*?)\/([cv])\/(\d+)/))) {
|
||||
return {
|
||||
id: m[1] + m[2],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue