mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Fix SimpleEditor not recognizing latest YouTube iframe code #2159
This commit is contained in:
parent
73ca0893d6
commit
6afb32f652
1 changed files with 17 additions and 17 deletions
|
|
@ -54,8 +54,8 @@
|
||||||
|
|
||||||
// Convert YouTube links.
|
// Convert YouTube links.
|
||||||
var convertYouTube = function(str) {
|
var convertYouTube = function(str) {
|
||||||
var regexp = /https?:\/\/(www\.youtube(?:-nocookie)?\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)\S*/g;
|
var regexp = /(?<!src=")https?:\/\/(www\.youtube(?:-nocookie)?\.com\/(?:watch\?v=|v\/|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)\S*/g;
|
||||||
var embed = '<iframe width="560" height="315" src="https://www.youtube.com/embed/$2" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><p></p>';
|
var embed = '<iframe width="560" height="315" src="https://www.youtube.com/embed/$2" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe><p></p>';
|
||||||
return String(str).replace(regexp, embed);
|
return String(str).replace(regexp, embed);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue