I have the video background plugin for site origin page builder (Wordpress) and I have uploaded a background video (MP4 and WEBM formats). The file sizes are around 35mb and 17mb respectively.
I have tested on a couple of iPhones running up to date iOS with safari and the video is not autoplaying as it should (only showing fallback image).
Video Code:
<video id="so_bgvideo_5df3a8b601042"
class="so_video_bg jquery-background-video is-playing is-visible"
loop="" autoplay="" playsinline="" muted="" data-bgvideo=""
poster="https://mywebsite.com/fallback-image.jpg"
data-bgvideo-fade-in="500" data-bgvideo-pause-after="120"
data-bgvideo-show-pause-play="true"
data-bgvideo-pause-play-x-pos="right"
data-bgvideo-pause-play-y-pos="top"
style="min-width: auto; min-height:auto; width: 100%; height: auto;
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
transition-duration: 500ms;">
<source src="https://mywebsite.com/video.mp4" type="video/mp4">
<source src="https://mywebsite.com/video.webm" type="video/webm">
</video>
As far as I can tell the video contains the attributes required via Safari (and it plays fine on Safari desktop).
Can anyone please advise a fix to get it working on Safari mobile?
Double-Click home button to get the task switcher outside of Safari, tap and hold on the safari icon until the kill button shows. Open safari (restarted). At this point, if you load the test page (the one with just one video), the poster will show.
If you turn on the Develop menu in Safari (Preferences » Advanced » check the box), you get the option to choose the User Agent string Safari will hand to a site to tell what browser it is. From the Develop menu, Choose User Agent » Mobile Safari 3.2. 2 - iPad and the site will switch to HTML5 if it supports it.
Safari supports HTML5. If YouTube video doesn't play, try either disabling or uninstalling extensions like ClickToFlash.
Safari doesn't allow autoplay of video on these 2 scenarios
To achieve autoplay, enable mute
and autoplay
in both attribute and via js like
<video id="BgVideo" muted autoplay>
<script>
var bgvideo = document.getElementById("BgVideo");
bgvideo.muted = true;
bgvideo.play();
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With