i'm trying to play video from url using AVPlayer.
but video is not playing.
because video url is "unsecure"(Not Secure).
but i've already allow NSAppTransportSecurity
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
here viewController Code
import AVKit
import AVFoundation
let playerViewController = AVPlayerViewController()
let url = Constants.API.imageURL + (GlobalVariables.sharedManager.userDetailObj.UserDetail?.intro_video_path)! //which is "http://23.97.79.216:8000/api/media/intro-video/video_file_2rg3tio.mp4"
//let videoURL = URL(string: "http://jplayer.org/video/m4v/Finding_Nemo_Teaser.m4v") //testing unsecure(Not Secure) url which is working.
let videoURL = URL(string: url)
let player = AVPlayer(url: videoURL!)
playerViewController.player = player
self.present(playerViewController, animated: true) {
self.playerViewController.player!.play()
}
as i mention in code that "http://jplayer.org/video/m4v/Finding_Nemo_Teaser.m4v" is unsecure(Not Secure) but its working fine.
but my url "http://23.97.79.216:8000/api/media/intro-video/video_file_2rg3tio.mp4" is not working.
there is any way that we can play video of unsecure(Not Secure) url?