Video autoplay in Chrome

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #690893
    Tim Mustoe
    Participant

    Hi all,

    Since Google updated its autoplay policy background video in Chrome will only play if the user “interacts” with it – which kind of ruins the effect.

    If the video is muted though, it will play automatically.

    The videos I have uploaded to the media library have no audio track, yet Chrome won’t play it on load, which leads me to think that I have to explicitly set it to mute in the code to be recognised as muted by the browser.

    But I can’t figure out how to do that in Emmet.

    Can anyone help?

    Thanks, Tim.

    #691081
    J. Davis
    Keymaster

    Hi Tim,

    Thank you for reporting this. In order to add needed attribute that indicates that video is muted you should follow the steps below:
    – navigate to /wp-content/themes/emmet/sections
    – open big_title.php file with file editor
    – find the following line <video id="video_background" preload="none" loop="loop"
    – replace that line with one below
    <video id="video_background" muted="true" preload="none" loop="loop"
    – save changes, clear the cache and try to view your site again.

    In case you want to save this change from theme update you can follow these easy steps:
    – install Child Theme (note you might need to re-configure some sections of the Front Page after activating Child Theme)
    – copy /wp-content/themes/emmet/custom-page.php file
    – paste it to /wp-content/themes/emmet-child/ folder
    – open this file in text editor, find ‘big_title.php’ text in this file and edit it into e.g. ‘my_big_title.php’ and save the changes.
    – after that navigate to /wp-content/themes/emmet/sections/ folder and rename the file big_title.php into my_big_title.php or the name you edited it within custom-page.php file

    However we’ll do our best to add this change in one of the next theme updates. Thank you.

    best regards,
    John

    #691764
    Tim Mustoe
    Participant

    Works a charm!

    Thanks John.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.