diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-04-08 17:45:00 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-04-08 17:45:00 +0200 |
| commit | 4c61621efbb079a4298db99d5c0b30b90e072bb9 (patch) | |
| tree | f6734b44a1ea45826be4f7a14191f7aaa3b75846 /addons/web_editor/static/src/js/widgets | |
| parent | b3d4c2d178bb3dbb9875271082bc36a80076e649 (diff) | |
| parent | 9a7e3c8b4986fcfecf3699a194e45f5ec94bde6c (diff) | |
[MERGE] forward port branch 11.0 up to 9a7e3c8b498
Diffstat (limited to 'addons/web_editor/static/src/js/widgets')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index b9e2a3289a0..27a5e41d06a 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -900,7 +900,7 @@ var VideoWidget = MediaWidget.extend({ 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 insRegExp = /(.*)instagram.com\/p\/(.[a-zA-Z0-9]*)/; @@ -927,8 +927,8 @@ var VideoWidget = MediaWidget.extend({ var autoplay = options.autoplay ? '?autoplay=1' : '?autoplay=0'; - if (ytMatch && ytMatch[1].length === 11) { - $video.attr('src', '//www.youtube.com/embed/' + ytMatch[1] + autoplay); + if (ytMatch && ytMatch[2].length === 11) { + $video.attr('src', '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + ytMatch[2] + autoplay); } else if (insMatch && insMatch[2].length) { $video.attr('src', '//www.instagram.com/p/' + insMatch[2] + '/embed/'); videoType = 'ins'; |
