Ghost/ghost/admin/app/modifiers/autoplay.js
Kevin Ansfield 98ce6bf4d5
Fixed onboarding checklist video logo autoplay (#19967)
closes https://linear.app/tryghost/issue/IPC-117/fix-ghost-orb-logo-not-being-animated-in-chrome-or-arc

- Chrome wasn't respecting the `muted` attribute when the dashboard is loaded without any interaction resulting in the video not auto playing
- fixed by adding a `{{autoplay}}` modifier that explicitly sets the `muted` property on the video before calling `.play()` which appears to bypass the interaction-required block
2024-04-02 13:55:22 +01:00

7 lines
147 B
JavaScript

import {modifier} from 'ember-modifier';
export default modifier((element) => {
element.muted = true;
element.play();
}, {eager: false});