diff options
| -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 |
