[IMP] web_editor: add "hide controls" option to vimeo video
Only youtube and dailymotion were able to add this property to their video. Maybe it was not supported by vimeo back then, but it seems to be supported now. It improves the vimeo youtube in two ways: 1. For background video, the controls are now hidden. There were visible for a few seconds before this PR which is not ideal 2. For non background video, there were no way to hide the controls which might be problematic to some users as in mobile there is the controls display but also an ugly "Tap to unmute" in the middle of the video. Step to reproduce (background video): - Drag & drop a "Text - Image" snippet and add it the biggest possible padding, also add padding to the image (so you see the full video and not just part of it) - Double click on the image, then on the video tab insert a vimeo url - Save, you will see the controls for a few seconds (progress bar, video title, link to vimeo, etc) Step to reproduce (non background video): - Drag & drop a "Text - Image" snippet and double click on the image - On the video tab, insert a vimeo url - Select "Auto Play" - Save and go to mobile, you will see the controls and an ugly "Tap to mute" in the middle of the video. The "Tap to mute" is a browser feature, not a vimeo feature. Browsers are muting video by default when auto play. Still, some people want to have a nice auto play video shown to users without sounds and don't want that overlay/controls. opw-2901256 closes odoo/odoo#96804 X-original-commit: 7128e4080511b5f224da3dce6d88ba8bcf9a0d47 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
@@ -35,7 +35,7 @@ export class VideoSelector extends Component {
|
||||
},
|
||||
hide_controls: {
|
||||
label: this.env._t("Hide player controls"),
|
||||
platforms: [this.PLATFORMS.youtube, this.PLATFORMS.dailymotion],
|
||||
platforms: [this.PLATFORMS.youtube, this.PLATFORMS.dailymotion, this.PLATFORMS.vimeo],
|
||||
urlParameter: 'controls=0',
|
||||
},
|
||||
hide_fullscreen: {
|
||||
|
||||
@@ -89,6 +89,8 @@ def get_video_url_data(video_url, autoplay=False, loop=False, hide_controls=Fals
|
||||
params['autoplay'] = autoplay and 1 or 0
|
||||
if autoplay:
|
||||
params['muted'] = 1
|
||||
if hide_controls:
|
||||
params['controls'] = 0
|
||||
if loop:
|
||||
params['loop'] = 1
|
||||
embed_url = f'//player.vimeo.com/video/{video_id}'
|
||||
|
||||
Reference in New Issue
Block a user