i have problem with HLS live stream. Sometimes when i created AVPlayer via code :
if let mediaUrl = URL(string: obj.message.replacingOccurrences(of: ".mpd", with: ".m3u8")) {
// load movie via url
self.player = AVPlayer(url: mediaUrl)
let layer = AVPlayerLayer(player: self.player)
self.streamView.layer.addSublayer(layer)
// set stream view where will be shown stream
layer.frame = self.streamView.layer.bounds
self.player.play()
}
I have blank screen with no stream and no error, but when i lock device and unlock then stream starts.
This case is once every 10/20 times when i'm trying to play stream.
Any suggestions?