2 years ago

#45389

test-img

Anh.LT

AVPlayer can't play HLS streaming with rate > x2.0 on iOS 15.x

I have a problem when playing the HLS stream with a rate > 2.0 on iOS 15.x

I try this code:

let strURL = "https://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/master.m3u8"

if let url = URL(string: strURL) {
    let asset = AVAsset(url: url)
    let playerItem = AVPlayerItem(asset: asset)
    player = AVPlayer(playerItem: playerItem)
    let layer = AVPlayerLayer(player: player)
    layer.frame = viewPlaying.bounds
    viewPlaying.layer.addSublayer(layer)
    player?.playImmediately(atRate: 4.0)
}

It wasn't playing on iOS 15.x, if I change to rate <= 2.0, it's normal. How can I fix this issue?

swift

avplayer

ios15

0 Answers

Your Answer

Accepted video resources