Frequently Asked Questions
Top
1. Why doesn't my video play?
Typically when media fails to load you will see this generic error message:
Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources
This is a complicated question to answer, as there are many possible reasons why the media can't be played, and it's not always easy to determine the reason - hence the generic error message.
In order for media to play, let's examine all of the conditions that need be true:
- The file must exist at the specified location
- Check that the file is at the location specified.
- The file cannot be in the /Assets folder unless it is within the /StreamingAssets subfolder.
- The Unity application must have permission to access this file
- For streaming:
- Platforms often prefer a HTTPS URL and will fail to load a HTTP URL unless forced, see platform notes (Android, iOS) for details.
- On Android make sure you have the
Internet Access
option inPlayer Settings
set torequire
. - On UWP make sure to enable the
InternetClient
capability option inPlayer Settings
- On WebGL it's best to use one of the javascript libraries (eg hls.js) for adaptive streaming
- On WebGL make sure there is not a CORS permission issue
- For MP4 files it's best if they're encoded with 'fast start' so they begin streaming immediately
- For local files:
- On Android make sure
Write Permissions
inPlayer Settings
is set toExternal (SDCard)
- On Android 11 there are changes to folder permissions - see Android article here
- On Android if the file is inside the application JAR (from
StreamingAssets
) and is very large, it may fail to decode because the JAR must be opened and uses a lot of memory. For large files we recommend instead streaming from a URL, or downloading it to the persistent storage path and playing from there.
- On Android make sure
- For streaming:
- Unity player must be set correctly
- The correct graphics API must be used, check the platform requirements. For example on Vulkan is not a supported graphics API on Android.
- The correct graphics API must be used, check the platform requirements. For example on Vulkan is not a supported graphics API on Android.
- The system must have sufficient resources to open and decode the media
- This is particularly true for mobile / tablet / portable VR platforms which have more resource constraints than desktops
- Memory and video decode resources are typical bottlenecks. Say your mobile platform supports up to 4K30 video, then you probably need to completely unload the video before playing the next one, as there are limited video decode resources.
- The container format (mp4 / mov / mkv / m3u8 etc) and audio-video codecs (h.264 / hevc / aac etc) must be supported
- See the section on Supported Media for different platforms
- See the section on Supported Media for different platforms
- The media codec specs (eg high resolution / frame-rate, 10-bit, 4:4:4, profile/level) must be supported by the hardware
- See the section on Supported Media for different platforms
- If your video is failing, check whether another simpler video plays (perhaps one of our included sample videos), it's possible that your system doesn't support a feature of the media
- If you're playing high resolution video, check the notes about this
- The
MediaPlayer
component must be configured correctly- If you're playing MKV files with 360 audio, then the Facebook 360 Audio options need to be set correctly
- You may need to select a specific API for video playback in the
Platform Specific
section depending on the media features
Note
Just because it plays in the editor doesn't mean it will play when you deploy to another platform. The editor is running on Windows / macOS which has completely different hardware capabilities to mobile devices.
2. How do I troubleshoot my issue?
Whether your video is failing to load, or there is a problem with the display, there are several common steps to help diagnose the cause of the issue:
Check the log file - the log file may contain useful error messages which will explain why the media failed to play. See Android notes on how to get the log file.
Check the conditions carefully in FAQ question 1.
Try loading one of our simple sample videos instead - eg
BigBuckBunny-360p30-H264.mp4
fromStreamingAssets/AVProVideoSamples
or streaming from our test URL: https://rh-testmedia.s3-eu-west-1.amazonaws.com/Samples/BigBuckBunny-360p30-H264.mp4