diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-07-12 13:09:45 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-07-12 13:59:35 +0000 |
| commit | 1f5a4649a67908ecb6acfec37673c8149de0471f (patch) | |
| tree | 2a8ac12942b2e6227459a236309054982a01158f /addons/web_editor/static/src | |
| parent | 6532b8716520d8cddc23a1e42c5c602b0c9c3c88 (diff) | |
| parent | 87fc1554d6a1823ac9061aab089adfd052190d21 (diff) | |
[MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6a1823
closes odoo/odoo#34820
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/widgets/media.js | 5 | ||||
| -rw-r--r-- | addons/web_editor/static/src/xml/wysiwyg.xml | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js index 3f808964beb..b196552709d 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js @@ -1108,7 +1108,7 @@ var VideoWidget = MediaWidget.extend({ return {errorCode: 0}; } - var autoplay = options.autoplay ? '?autoplay=1' : '?autoplay=0'; + var autoplay = options.autoplay ? '?autoplay=1&mute=1' : '?autoplay=0'; if (ytMatch && ytMatch[2].length === 11) { $video.attr('src', '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + ytMatch[2] + autoplay); @@ -1137,7 +1137,8 @@ var VideoWidget = MediaWidget.extend({ $video.attr('src', $video.attr('src') + '&rel=0'); } if (options.loop && (ytMatch || vimMatch)) { - $video.attr('src', $video.attr('src') + '&loop=1'); + var videoSrc = _.str.sprintf('%s&loop=1', $video.attr('src')); + $video.attr('src', ytMatch ? _.str.sprintf('%s&playlist=%s', videoSrc, ytMatch[2]) : videoSrc); } if (options.hide_controls && (ytMatch || dmMatch)) { $video.attr('src', $video.attr('src') + '&controls=0'); diff --git a/addons/web_editor/static/src/xml/wysiwyg.xml b/addons/web_editor/static/src/xml/wysiwyg.xml index 9ed3d2010da..baff05e2356 100644 --- a/addons/web_editor/static/src/xml/wysiwyg.xml +++ b/addons/web_editor/static/src/xml/wysiwyg.xml @@ -318,7 +318,11 @@ </div> <div class="o_video_dialog_options d-none mt-4"> <div class="o_yt_option o_vim_option o_dm_option"> - <label class="o_switch mb0"><input id="o_video_autoplay" type="checkbox"/><span/>Autoplay</label> + <label class="o_switch mb0"> + <input id="o_video_autoplay" type="checkbox"/><span/> + <span style="margin-right: 8px;">Autoplay</span> + <span class="small text-muted" style="margin-left: auto;">Videos are muted when autoplay is enabled</span> + </label> </div> <div class="o_yt_option o_vim_option"> <label class="o_switch mb0"><input id="o_video_loop" type="checkbox"/><span/>Loop</label> |
