diff --git a/inc/config.php b/inc/config.php index 81eb58a2..c036ac4e 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1181,6 +1181,29 @@ ) ); + // Youtube.js embed HTML code + $config['youtube_js_html'] = '
'. + ''. + ''. + '
'; + + // To embed YouTube thumbnails locally and avoid users connecting to YouTube servers when loading threads, + // add the following code to your config. You will probably need to fix it for the other services. + /* + $config['youtube_js_html'] + = '
' + . '' + . '' + . '
'; + + $config['embedding'] = array(); + $config['embedding'][0] = + array( + '/^https?:\/\/(\w+\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', + $config['youtube_js_html'] + ); + */ + // Embedding width and height. $config['embed_width'] = 300; $config['embed_height'] = 246; @@ -2091,12 +2114,6 @@ // is the absolute maximum, because MySQL cannot handle table names greater than 64 characters. $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}'; - // Youtube.js embed HTML code - $config['youtube_js_html'] = '
'. - ''. - ''. - '
'; - // Password hashing function // // $5$ <- SHA256 diff --git a/js/youtube.js b/js/youtube.js index 2eca99ae..2b4ac074 100644 --- a/js/youtube.js +++ b/js/youtube.js @@ -29,16 +29,20 @@ onready(function(){ function addEmbedButton(index, videoNode) { videoNode = $(videoNode); + var contents = videoNode.contents(); var videoId = videoNode.data('video'); var span = $("[Embed]"); var embedNode = $('