MPMoviePlayerController seek forward in fullscreen mode until end is stuck

前端 未结 4 2070
无人共我
无人共我 2021-01-18 10:52

There seems to be a problem with the MPMoviePlayerController where once you\'re in fullscreen mode and you hold down the fast forward button, letting it seek forward (playin

4条回答
  •  失恋的感觉
    2021-01-18 11:23

    Ran into the same issue on iOS6. Managed to fix it by registering for the MPMoviePlayerPlaybackDidFinishNotification (as suggested by Leuguimerius) with the following implementation:

    - (void)playbackDidFisnish:(NSNotification *)notif {
        if (self.player.currentPlaybackTime <= 0.1) {
        dispatch_async(dispatch_get_main_queue(), ^{
            [self.player stop];
            [self.player play];
            [self.player pause];
            });
        }
    }
    

    Where self.player is the associated MPMoviePlayerController instance. The check against currentPlaybackTime serves to distinguish the more standard invocations of playbackDidFinish (where the movie is allowed to play at normal speed until its end) from those scenarios where the user fast forwards until the end. Stopping then playing and pausing results in a usable, visually consistent interface even when fast-forwarding to the end.

提交回复
热议问题