我正在使用本地服务器来获取AVPlayer的URL。服务器没有任何域名。 像https://some_ip_addr:port/project/SampleVideo.mp4 AVPlayer不会播放https网址,但会播放http网址。 服务器没有任何域名。 AVPlayer是否需要一些额外的编码来播放https请求?我错过了什么吗?
player = AVPlayer(url: url)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
NotificationCenter.default.addObserver(self, selector: Selector(("playerDidReachEndNotificationHandler:")), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: player!.currentItem)
self.present(playerViewController, animated: true)
{
playerViewController.player!.play()
}