Free and Premium WordPress Plugins & Themes Forums WordPress Themes Emmet Video autoplay in Chrome
- This topic has 2 replies, 2 voices, and was last updated 6 years, 5 months ago by Tim Mustoe.
- AuthorPosts
- June 20, 2018 at 5:07 pm #690893Tim MustoeParticipant
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.
June 21, 2018 at 9:50 am #691081J. DavisKeymasterHi 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 fileHowever we’ll do our best to add this change in one of the next theme updates. Thank you.
best regards,
JohnJune 22, 2018 at 3:29 pm #691764Tim MustoeParticipantWorks a charm!
Thanks John.
- AuthorPosts
- You must be logged in to reply to this topic.