Video Not Playing on Your Website? 7 Causes and How to Fix Them
Updated October 31, 2026
Website videos usually fail because of autoplay rules, an unsupported format, or a blocked embed. Browsers only autoplay muted video, and iPhones also need the playsinline attribute. Use H.264 MP4 for the widest support. If an embed is blank, check its domain settings and your Content Security Policy for a blocked frame.
Quick diagnosis
- Hero video shows a blank box on iPhone: missing
mutedorplaysinline. - Plays in some browsers only: the codec isn't supported there.
- YouTube or Vimeo embed is blank: privacy settings or a blocked iframe.
- Spins forever: the file is too large, or the server doesn't support range requests.
Causes and fixes
Autoplay rules block the video
Most commonBrowsers block autoplay with sound. Safari on iPhone also needs playsinline, or the video waits for a tap and shows a blank box or a play icon in your hero section.
Fix: Add autoplay muted loop playsinline to the video tag. Set a poster image so visitors never see an empty box.
The format or codec isn't supported
An .mp4 file is only a container. The H.265 or AV1 video inside may not play in every browser, so the same file can work on your Mac and fail elsewhere.
Fix: Encode to H.264 video with AAC audio in MP4, which plays nearly everywhere, and offer other formats through extra source tags.
The embed is restricted
Vimeo domain limits, private YouTube videos and disabled embedding all produce an error or a blank frame on your site while the video plays fine on its own page.
Fix: Allow your domain in the video's privacy settings and turn on embedding. Check it while signed out, since owners can often see private videos.
Your security headers block the frame
A Content Security Policy without the video host in frame-src stops the iframe, and media-src does the same for direct files. The console names the blocked URL.
Fix: Add the host to frame-src or media-src, such as https://www.youtube-nocookie.com for YouTube embeds.
The file is too big for mobile data
A 100 MB hero video can spin for a long time on a phone, and Low Power Mode on iPhones can stop autoplay. Visitors leave before anything plays.
Fix: Compress to a few megabytes, use a video host for long clips, and show the poster image to visitors on saved-data connections.
The server doesn't support range requests
Safari asks for video in small byte ranges. If your server ignores those requests, the video can fail in Safari while Chrome plays it.
Fix: Serve video through a CDN or host that returns status 206 for range requests, and confirm with curl -I -H "Range: bytes=0-1".
A consent tool or blocker holds the embed
Cookie tools often block YouTube and Vimeo until a visitor accepts, leaving an empty space. Ad blockers can also hide video players.
Fix: Show a clear placeholder with a link to the video, and use privacy-friendly embeds such as youtube-nocookie.com.
How to find it on your site
- 1
Open the console
Reload with the console open and look for blocked frames, autoplay notices and media errors.
- 2
Filter Network by Media
A red request means the file is missing. A request stuck on pending points at size or range support.
- 3
Test the direct file
Open the video URL in a tab. If it fails there too, the problem is the file or the server, not your page.
- 4
Test on a real iPhone
Use Safari with Low Power Mode both on and off, since that's where most autoplay bugs appear.
Fixes by platform
Shopify
Upload video to Files or a product's media so Shopify transcodes it. Check any cookie banner app, since it can block YouTube embeds in the EU.
WordPress
Lazy-load plugins often replace embeds with placeholders that fail. Exclude the video from lazy loading, and host large files on a video service, not your media library.
Wix and Squarespace
Hero videos may be replaced by a still image on mobile by design. Check the mobile editor before you treat it as a bug.
Custom code
Add preload="metadata", a poster, and playsinline. Handle the promise from video.play(), which rejects when autoplay is blocked.
Frequently asked questions
Why won't a video play on my website?
The usual causes are browser autoplay rules, a codec the browser can't play, a restricted or blocked embed, or a file too large for the connection. Check the console first, then try opening the video file directly.
Why does my video play on desktop but not on iPhone?
iPhones only autoplay video that is muted and has the playsinline attribute. Low Power Mode can also stop it. Safari also needs the server to support range requests.
What is the best video format for websites?
H.264 video with AAC audio in an MP4 file plays in nearly every browser. Add a smaller WebM or AV1 version as an extra source if you want better compression.
Why is my YouTube embed blank?
The owner may have disabled embedding, the video may be private, your Content Security Policy may block the frame, or a cookie tool may be holding it until consent. Open the console to see which.