|
|
|
@ -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) |
|
|
|
|