Resume AVPlayer video playback after app become active

后端 未结 5 1310
天涯浪人
天涯浪人 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:33

    Use the UIApplicationWillEnterForegroundNotification as well. That way you know your app will be active and visible to the user:

    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(appEnteredForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
    

提交回复
热议问题