diff --git a/inc/config.php b/inc/config.php index ddf23279..10c9faa5 100644 --- a/inc/config.php +++ b/inc/config.php @@ -999,8 +999,8 @@ // It's very important that you match the entire input (with ^ and $) or things will not work correctly. $config['embedding'] = array( array( - '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', - '' + '/^https?:\/\/(?:\w+\.)?(?:youtube\.com\/watch\?|youtu\.be\/)(?:(?:&?v=)?([a-zA-Z0-9\-_]{10,11})\??|&?(start=\d*)|&?(end=\d*)|(?:&?[^&]+))*$/i', + '' ), array( '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i', @@ -1657,7 +1657,7 @@ $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}'; // Youtube.js embed HTML code - $config['youtube_js_html'] = '
'. + $config['youtube_js_html'] = '
'. ''. - ''. + ''. '
'; diff --git a/inc/instance-config.php b/inc/instance-config.php index f6b4d0b6..5076da2a 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -162,7 +162,7 @@ $config['embedding'] = array( array( - '/^https?:\/\/(\w+\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', + '/^https?:\/\/(?:\w+\.)?(?:youtube\.com\/watch\?|youtu\.be\/)(?:(?:&?v=)?([a-zA-Z0-9\-_]{10,11})\??|&?(start=\d*)|&?(end=\d*)|(?:&?[^&]+))*$/i', $config['youtube_js_html'] ), array( diff --git a/js/youtube.js b/js/youtube.js index 9fe81b60..c4ef77fb 100644 --- a/js/youtube.js +++ b/js/youtube.js @@ -26,11 +26,9 @@ onready(function(){ var do_embed_yt = function(tag) { $('div.video-container a', tag).click(function() { - var videoID = $(this.parentNode).data('video'); - $(this.parentNode).html('