Actually fixed regex.
This commit is contained in:
parent
7e7da76006
commit
ce3ac634cb
1 changed files with 2 additions and 2 deletions
|
@ -209,11 +209,11 @@ plugins.factory('userPlugins', function() {
|
|||
* See: https://developers.google.com/youtube/player_parameters
|
||||
*/
|
||||
var youtubePlugin = new UrlPlugin('YouTube video', function(url) {
|
||||
var regex = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/i,
|
||||
var regex = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,
|
||||
match = url.match(regex);
|
||||
|
||||
if (match){
|
||||
var token = match[2],
|
||||
var token = match[1],
|
||||
embedurl = "https://www.youtube.com/embed/" + token + "?html5=1&iv_load_policy=3&modestbranding=1&rel=0",
|
||||
element = angular.element('<iframe></iframe>')
|
||||
.attr('src', embedurl)
|
||||
|
|
Loading…
Reference in a new issue