summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-07-05 11:13:53 +0200
committerChristophe Simonis <chs@odoo.com>2019-07-05 11:13:53 +0200
commit039e6bae9916aaa9d82bc558817a7ed7d0ea3c68 (patch)
treefa0f0e71de1c077db86593704eb83fc1b2115e87 /addons/web_editor/static/src
parent50d21df1561f660c184329cfc4cb567ea5d79ace (diff)
parent9c742d0c656412beba7201085abd4cecc81f5d27 (diff)
[MERGE] forward port branch 12.0 up to 9c742d0c656
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/widgets/media.js5
-rw-r--r--addons/web_editor/static/src/xml/wysiwyg.xml6
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 8e8d6fbf850..46146e962c2 100644
--- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
+++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
@@ -931,7 +931,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);
@@ -960,7 +960,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 cd20ee3f4ef..b45525e9deb 100644
--- a/addons/web_editor/static/src/xml/wysiwyg.xml
+++ b/addons/web_editor/static/src/xml/wysiwyg.xml
@@ -252,7 +252,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>