Possible fix of Safari autoplay
-
This is all of my code of video-html5.php, also you can add variable with preload attribute to plugin, because I’m loading many videos asynchrously on mobile for Google Core Vitals. Playsinline fixes autoplay in all Safari browsers. Code:
<div id="<?php echo $el_id; ?>" class="video-player-for-wpbakery <?php echo $el_class; ?>"> <div class="video-player-for-wpbakery-container"> <video width="<?php echo $width; ?>" height="<?php echo $height; ?>" <?php echo $controls; ?> <?php echo $autoplay; ?> <?php echo $loop; ?> <?php echo $muted; ?> <?php if(isset($autoplay)){if($autoplay=="autoplay"){ ?> playsinline <?php }} ?> preload="none"> <source src="<?php echo $url; ?>" type="<?php echo $mime_type; ?>"> <?php _e('Your browser does not support the video tag.', 'video-player-for-wpbakery'); ?> </video> </div> </div>
Also you have typo in CHANGELOG.
- The topic ‘Possible fix of Safari autoplay’ is closed to new replies.