diff --git a/addons/website/static/src/client_actions/website_preview/website_preview.js b/addons/website/static/src/client_actions/website_preview/website_preview.js index 9d264cb0814a94be121a6a85b7c9db4a102cb1eb..d40b77ebedbdff95fa8afd250adb4db761772bd7 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview.js +++ b/addons/website/static/src/client_actions/website_preview/website_preview.js @@ -431,9 +431,9 @@ export class WebsitePreview extends Component { * the iframefallback content. */ _cleanIframeFallback() { - // Remove autoplay in all media video iframes urls so videos are not + // Remove autoplay in all iframes urls so videos are not // playing in the background - const iframesEl = this.iframefallback.el.contentDocument.querySelectorAll(".media_iframe_video iframe"); + const iframesEl = this.iframefallback.el.contentDocument.querySelectorAll("iframe"); for (const iframeEl of iframesEl) { const url = new URL(iframeEl.src); url.searchParams.delete('autoplay'); diff --git a/addons/website_slides/static/src/client_actions/website_preview/website_preview.js b/addons/website_slides/static/src/client_actions/website_preview/website_preview.js index 8b53487dd8bc721214c7688946f5dbe01ff869c3..1b81174c9e646a12bf9c9521afab601b3ef227fb 100644 --- a/addons/website_slides/static/src/client_actions/website_preview/website_preview.js +++ b/addons/website_slides/static/src/client_actions/website_preview/website_preview.js @@ -5,17 +5,11 @@ import { WebsitePreview } from '@website/client_actions/website_preview/website_ patch(WebsitePreview.prototype, 'website_slides_website_preview', { /** + * @todo remove me in master, the cleaning of iframe is now done + * globally in the website part * @override */ _cleanIframeFallback() { - // Remove autoplay in all youtube videos urls so videos are not playing - // in the background - const playersEl = this.iframefallback.el.contentDocument.querySelectorAll('[id^=youtube-player]'); - for (const playerEl of playersEl) { - const url = new URL(playerEl.src); - url.searchParams.delete('autoplay'); - playerEl.src = url.toString(); - } return this._super(...arguments); } });