AVPlayer does not play video Instantly on iOS 10, while audio playing only

后端 未结 4 935
南方客
南方客 2021-02-09 00:15

I am creating video with AVAssetExportSession and playing video when it finishes. But Visual Part not showing instantly but only audio is playing instantly. Visual part comes af

4条回答
  •  攒了一身酷
    2021-02-09 00:23

    Try to set automaticallyWaitsToMinimizeStalling property of AVPlayer to NO in order to start playback immediately.

    _avPlayer = [[AVPlayer alloc]init]; //WithPlayerItem:_avPlayerItem];
    _avPlayer.automaticallyWaitsToMinimizeStalling = NO;
    

    But if sufficient content is not available for playing then player might stall.

    Apple documentation: https://developer.apple.com/reference/avfoundation/avplayer/1643482-automaticallywaitstominimizestal.

    Hope this helps.

提交回复
热议问题