summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-04 18:33:42 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-04 18:33:42 +0200
commit6e0c89867e31df63f79f067fae15f10d0793ab00 (patch)
treee22c3d1a95b3b3450ce5525ee07a2cd25131b455 /addons/web_editor/static/src
parentd158a8ffbfa3b7ad1c22aff938bb630bf53cea97 (diff)
parent60592561d71cc4a216b1bcafa3169f3b27af61f8 (diff)
[MERGE] forward port branch 10.0 up to 60592561d71
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/widgets.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index a3a990a7baf..ddf94e147a7 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -769,7 +769,7 @@ function createVideoNode(url, options) {
options = options || {};
// video url patterns(youtube, instagram, vimeo, dailymotion, youku)
- var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
+ var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube(-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((?:\w|-){11})(?:\S+)?$/;
var ytMatch = url.match(ytRegExp);
var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/;
@@ -788,10 +788,10 @@ function createVideoNode(url, options) {
var youkuMatch = url.match(youkuRegExp);
var $video = $('<iframe>');
- if (ytMatch && ytMatch[1].length === 11) {
- var youtubeId = ytMatch[1];
+ if (ytMatch && ytMatch[2].length === 11) {
+ var youtubeId = ytMatch[2];
$video = $('<iframe>', {
- src: '//www.youtube.com/embed/' + youtubeId,
+ src: '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + youtubeId,
width: '640',
height: '360'
});