diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-04-04 19:34:35 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-04-04 19:34:35 +0200 |
| commit | 214e819c1bbbbea2c55adc8feab6a269a845cdd4 (patch) | |
| tree | 7dcf2795b68a01b0c09dd41f2b3c693fb6313b46 /addons/web_editor/static/src | |
| parent | 180f105508c277076734d59265b5120bd8b2d6fb (diff) | |
| parent | 6e0c89867e31df63f79f067fae15f10d0793ab00 (diff) | |
[MERGE] forward port branch saas-14 up to 6e0c89867e3
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets.js | 8 |
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 25b2385222f..a9f7538a036 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -768,7 +768,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]*)/; @@ -787,10 +787,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' }); |
