As a complement to this, one of the reasons mp4 files sometimes do not play in AVPlayer comes down to one checkbox.
When you drag and drop to add a video file to the Xcode project, the panel crashes with some parameters. One such option is "Add to targets:".
from Xcode: dragging and dropping a video file
In .MOV files you do not need to check this box. With all other file formats you need to check this box.
So, maybe if you are like me, you spend about a day or so exploring AVAsset, etc., trying to understand why the file does not seem to load.
This is the answer. Check box. Only mp4, not MOV.
Because Apple.
source share