You're trying to delay the homepage load until a video finishes, ensure HD video loads on larger screens, and solve an issue with audio not playing. Here’s how to approach each.
1. Delay Homepage Load Until Video Ends
- Autoplay video and detect when it finishes: Webflow doesn’t support JS by default, but you can add custom code to interact with your video element (like watching for the
ended
event). - Steps:
- Embed your video using a native HTML video element (not background video component).
- Assign it an ID (e.g.,
introVideo
) and add a cover div over your homepage. - Use custom code in the page footer to hide the cover only when the video ends. Example snippet (remove for this guideline but keep in implementation):
- On video ended ➝ hide cover / show main content.
- Alternative (if using Webflow interactions):
- You can create a timed interaction that lasts the same length as your video.
- Not reliable if users skip or if the video doesn’t load consistently.
2. Ensure HD Video Loads on Large Screens
- Upload multiple video resolutions, serve the HD version for large screens using custom HTML with source elements:
- Example: Load 720p for small screens, 1080p for large.
- Since Webflow’s background video component compresses files:
- Avoid Webflow’s built-in background video if quality is a concern.
- Use a native
<video>
tag with multiple sources and use media queries or the media
attribute in <source>
tags to load appropriate resolution. - Optimize for pixelation:
- Compress video externally using tools like HandBrake at higher bitrates.
- Use MP4 (H.264) for broad compatibility.
3. Fix Missing Audio Playback
- Most browsers block autoplay with audio due to autoplay policies.
- To enable audio:
- Do not autoplay with sound enabled. Either:
- Let users click a Play button first (preferred method), or
- Set the video to autoplay muted, and allow users to unmute it later.
- Background videos in Webflow are muted by default and cannot play audio.
- Use a native video element instead if you need audio.
- Check browser console for media errors and confirm there's no CORS restriction or file load issue.
Summary
To make your Webflow homepage wait for a video to end, use a custom video element with JS to reveal content after playback. Serve HD video using multiple resolutions linked in a native video tag. For audio, autoplay must be muted—add a user-triggered control to allow sound playback due to browser restrictions.