I have used the AVPlayer to play the video. Here is the sample code.
player = AVPlayer(url: url)
playerViewController.player = player
player.play()
present(playerViewController, animated: false, completion: nil)
This code plays most of the videos just some videos sent from android or downloaded is not played. Although all the videos are in mp4 format. When i looked the videos info in my mac, I found out the following differences.
Videos not played by ios gallery, quick time and safari : Codecs: AAC, h.264 Color profile: (5-1-5)
(whatsapp is able to play this video)
Videos played by all iOS devices and platforms: Codecs: AAC, h.264 Color profile: (1-1-1)
Is there a way I can make all mp4 play in my iOS app.