diff options
| author | Jules <jules@asdf.us> | 2017-10-19 11:53:08 -0400 |
|---|---|---|
| committer | Jules <jules@asdf.us> | 2017-10-19 11:53:08 -0400 |
| commit | 82c7281d6dfb806c9f1861a5ada4247277ac0177 (patch) | |
| tree | 251ec96bdea51c52aa4a385f235acc81c5484ad2 /frontend/static/js/sj_compiled.js | |
| parent | 849ebd28a2388e3257cb360a4609d3e9dfc77dc0 (diff) | |
youtu.be
Diffstat (limited to 'frontend/static/js/sj_compiled.js')
| -rwxr-xr-x | frontend/static/js/sj_compiled.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/frontend/static/js/sj_compiled.js b/frontend/static/js/sj_compiled.js index a8a6891..8e0c834 100755 --- a/frontend/static/js/sj_compiled.js +++ b/frontend/static/js/sj_compiled.js @@ -4051,7 +4051,7 @@ var Playlist = // block video if it's a duplicate } var url = row[4] - if (url.indexOf("youtube.com") !== -1) + if (url.indexOf("youtube.com") !== -1 || url.indexOf("youtu.be") !== -1) { var ytid = Youtube.getYtid(url) video.type = "youtube" @@ -4496,6 +4496,15 @@ var Youtube = height: "100%", getYtid: function (url) { + if (url.indexOf("youtu.be")){ + var reg = /youtu\.be\/([A-Za-z0-9]+)/ + var matches = reg.exec(url) + if (matches){ + console.log(matches[1]) + return matches[1] + } + + } if (! url) return var ytid = url.substr(url.indexOf("v=")+2,11) if (ytid.indexOf("&") !== -1) @@ -5014,7 +5023,7 @@ var Chat = var word = words[i] if (word.indexOf("http") !== -1) { - if (word.indexOf("youtube.com/watch?") !== -1) + if (word.indexOf("youtube.com/watch?") !== -1 || word.indexOf("youtu.be") !== -1 ) { var ytid = "youtube_"+Youtube.getYtid(word) var txt |
