commit
8bdefaa20b
@ -209,12 +209,12 @@ plugins.factory('userPlugins', function() {
|
|||||||
* See: https://developers.google.com/youtube/player_parameters
|
* See: https://developers.google.com/youtube/player_parameters
|
||||||
*/
|
*/
|
||||||
var youtubePlugin = new UrlPlugin('YouTube video', function(url) {
|
var youtubePlugin = new UrlPlugin('YouTube video', function(url) {
|
||||||
var regex = /(?:youtube\.com|youtu\.be)\/(?:v\/|embed\/|watch(?:\?v=|\/))?([a-zA-Z0-9_-]+)/i,
|
var regex = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,
|
||||||
match = url.match(regex);
|
match = url.match(regex);
|
||||||
|
|
||||||
if (match){
|
if (match){
|
||||||
var token = match[1],
|
var token = match[1],
|
||||||
embedurl = "https://www.youtube.com/embed/" + token + "?html5=1&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0",
|
embedurl = "https://www.youtube.com/embed/" + token + "?html5=1&iv_load_policy=3&modestbranding=1&rel=0",
|
||||||
element = angular.element('<iframe></iframe>')
|
element = angular.element('<iframe></iframe>')
|
||||||
.attr('src', embedurl)
|
.attr('src', embedurl)
|
||||||
.attr('width', '560')
|
.attr('width', '560')
|
||||||
|
Loading…
Reference in New Issue
Block a user