Prompt
How do I troubleshoot videos that play fine on desktop but fail on mobile?
Latest observation
If a video works on desktop but fails on mobile, the issue is usually one of these: codec support, file size/bitrate, encoding settings, autoplay restrictions, network/loading behavior, or CSS/player configuration. Here’s a practical troubleshooting checklist.
1) Confirm the video format is mobile-compatible
Mobile browsers are stricter than desktop.
- Use MP4 (H.264 video + AAC audio) for broadest support.
- Avoid relying on:
- WebM only if you need iOS/Safari support
- HEVC/H.265 unless you’ve confirmed device/browser support
- unusual audio codecs
- If possible, provide multiple sources:
video.mp4(H.264/AAC)video.webmas a fallback for browsers that support it
2) Check encoding settings
A video can be “MP4” and still not play on mobile due to the way it was encoded.
Recommended baseline:
- Video: H.264 baseline/main profile
- Audio: AAC-LC
- Container: MP4
- Pixel format: yuv420p
- Frame rate: reasonable and constant if possible
- Resolution: keep it modest for mobile
- Bitrate: not too high
Things that often break mobile playback:
- Variable or very high bitrate
- Unsupported profile/level
- Missing AAC audio track
- Nonstandard pixel format
- Corrupt or unusual metadata
3) Make sure the file is “fast start” / streamable
If the video starts with the moov atom at the end of the MP4, mobile browsers may wait forever or fail to begin playback.
Fix by optimizing for web:
- Repackage MP4 for progressive download
- Ensure the file is “fast start”
Example with ffmpeg:
ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4
4) Test autoplay rules on mobile
Mobile browsers often block autoplay, especially with sound.
If your video is supposed to autoplay:
- Add
muted - Add
playsinline - Consider
autoplayonly for muted videos
Example:
<video autoplay muted playsinline controls>
<source src="video.mp4" type="video/mp4">
</video>
Notes:
- iOS Safari requires
playsinlinefor inline playback. - Autoplay with audio usually won’t work without user interaction.
5) Check if the video is too large or too heavy
Mobile devices and networks may fail on:
- Very large files
- High resolution (4K, 1080p at high bitrate)
- Long videos with large initial buffering
- Slow cellular connections
Try:
- Lower resolution for mobile variants
- Lower bitrate
- Shorter GOP/keyframe interval
- Adaptive streaming if appropriate
6) Verify server headers and delivery
Sometimes the issue isn’t the file itself.
Check:
Content-Type: video/mp4Accept-Ranges: bytesenabled- Correct CORS headers if video is loaded cross-origin
- No broken redirects
- No authorization/session issue that affects mobile browsers
Why this matters:
- Some browsers need byte-range requests to seek and stream efficiently.
- Incorrect MIME type can prevent playback.
- Cross-origin video may fail without proper CORS.
7) Inspect browser console and network errors
Use remote debugging:
- iOS Safari: Safari Web Inspector on a Mac
- Android Chrome:
chrome://inspect
Look for:
MEDIA_ERR_SRC_NOT_SUPPORTED- CORS errors
- 404/403 responses
- MIME type mismatches
- decode errors
- stalled network requests
8) Check the HTML/video player configuration
Make sure the markup is simple and valid.
Good baseline:
<video controls playsinline preload="metadata">
<source src="video.mp4" type="video/mp4">
Sorry, your browser doesn't support embedded video.
</video>
Potential issues:
- Missing
typeattribute - JS player libraries that behave differently on mobile
- Custom controls blocking native playback
- CSS causing the video to be hidden, zero-sized, or overlaid incorrectly
9) Verify aspect ratio and CSS
Sometimes the video is playing, but not visible.
Check:
display,position,z-indexwidth/heightnot set to 0- Parent containers not clipping it
object-fitbehavioroverflow: hiddennot masking the player
10) Test on multiple real devices
A video may fail on:
- iPhone Safari but work on Chrome Android
- Older devices with limited codec support
- Low-memory devices
Test at least:
- iOS Safari
- Android Chrome
- Another browser on each platform if possible
11) If using streaming, check HLS/DASH support
For adaptive streaming:
- iOS Safari natively supports HLS
- Android support varies depending on browser/player
- Desktop may support more cases than mobile
If streaming manifests are involved, confirm:
- Correct playlist URLs
- Segments accessible
- MIME types correct
- Encryption/DRM compatibility if used
12) Create a minimal test case
Strip everything down to isolate the issue:
- Plain HTML page
- One simple
<video>tag - One known-good MP4
- No JS framework, no custom player, no overlays
If that works, the issue is likely in:
- your player code
- CSS
- server/CDN
- encoding variant
Quick “known good” setup
Try this first:
<video controls playsinline preload="metadata" width="100%">
<source src="video.mp4" type="video/mp4">
</video>
And encode with:
- H.264 video
- AAC audio
-movflags +faststart
If you want, I can also give you a step-by-step debugging flowchart or help diagnose a specific video URL/encoding report.
Brands