Resume AVPlayer video playback after app become active

后端 未结 5 1308
天涯浪人
天涯浪人 2021-02-02 15:53

I write custom player from AVPlayer for video playback. According to Apple docs set the video layer:

    self.player = [IPLPlayer new];
    self.player.playerLa         


        
5条回答
  •  [愿得一人]
    2021-02-02 16:43

    After some research I've found, that the same bag is in iOS player (WebBrowser, MPMoviePlayerController). May be because distribution type of content is Progressive Download.

    So solution is:

    • Use below notifications and save current time.
    • After app is resumed, recreate AVPlayer and start playing from saved time.

    In all other cases image is blocked, or view become black.

提交回复
热议问题