Frozen background videos on Safari/iOS when returning to a Webflow portfolio site are usually caused by how iOS handles autoplay videos and memory management during back-navigation.
1. iOS Safari Resource Handling
- Safari on iOS aggressively manages memory, especially with background tabs or upon navigating away and returning.
- When you hit the back button, Safari may restore a cached version of the page, including the video element in a frozen or paused state.
2. Autoplay and Inline Playback Limitations
- iOS requires video elements to have specific attributes to autoplay: autoplay, muted, playsinline, and loop.
- If any of these are missing or dynamically altered, the video may not resume playback automatically when returning to the page.
3. Lazy Loading or Custom Code Issues
- If you're using custom code to load videos dynamically or manipulating video elements with JavaScript, it may not re-trigger on back-navigation.
- Safari doesn’t always re-execute JavaScript when restoring a page from cache, which may leave your scripts inactive.
4. Video Not Reloaded Properly
- The background video may not fire the play() function on session restore.
- You may need a JavaScript snippet listening for the
pageshow
event (not load
) to manually play the video when the page is shown again from the bfcache (back-forward cache).
5. Using Webflow’s Video Background Element
- If you’re using Webflow’s native Background Video component, remember it uploads a compressed
.mp4
internally. - Sometimes, the Webflow background video doesn't reinitialize well on iOS unless a manual trigger is added.
Summary
The background video freezes in Safari/iOS when returning to a Webflow page due to iOS caching behavior, autoplay requirements, and JavaScript not re-running after back-navigation. Ensure video attributes include autoplay
, muted
, playsinline
, and use JavaScript listening for the pageshow
event to force a replay if needed.