How do I added the playsinline attribute to the background video players? It has autoplay loop muted which is good.
I tried the below but did not work
(function($){
$(‘video’).attr(‘playsinline’,’’);
})(jQuery);
How do I added the playsinline attribute to the background video players? It has autoplay loop muted which is good.
I tried the below but did not work
(function($){
$(‘video’).attr(‘playsinline’,’’);
})(jQuery);
Hello @allcal,
Thanks for writing in! Regretfully the code will not work. Please check out the reply of @Christian for more detailed explanation:
Best Regards.
Ok, so i looked at the other post and added a video element and that also doesn’t autoplay on mobile or have the “playsinline” attribute. Regardless, how can I add the “playsinline” attribute to the video element and the video background with javascript or a file edit?
-----update------
I added an html video code and it does autoplay on mobile. Please help me duplicate on the built in pro video/video background
<video autoplay loop muted playsinline>
<source src="https://cdn.oneilsoftware.com/wp-content/uploads/2021/12/08165604/Record-Centers-ONeil-Secure-Google-Chrome-2021-12-07-15-55-09_Trim_Trim.mp4" type="video/mp4">
</video>
----Solution! -----
I figured out the solutions. JS below adds the playsline attribute and video will autoplay on mobile. This theme really should have that as an option in the video player.
jQuery( document ).ready( function() {
jQuery( 'video' ).attr('playsinline', '');
});
Hello @allcal,
Thank you for sharing the information. We are really glad that you have resolved your issue.
Cheers.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.