我更新ios 12.2后,MPMoviePlayerController使用的旧代码无法正常工作
if let state: MPMoviePlaybackState = mediaPlayer?.playbackState {
switch state
{
case MPMoviePlaybackState.stopped:
debugPrint("stopped")
break
case MPMoviePlaybackState.interrupted:
debugPrint("interrupted")
break
case MPMoviePlaybackState.seekingForward:
debugPrint("forward")
break
case MPMoviePlaybackState.seekingBackward:
debugPrint("backward")
break
case MPMoviePlaybackState.paused:
debugPrint("paused")
if !withPlayerControls {
aiLoader.isHidden = false
}
break
case MPMoviePlaybackState.playing:
if isLoadStatePlaying {
aiLoader.isHidden = true
}
debugPrint("playing")
break
}
}
默认情况下,它会重定向到MPMoviePlaybackState.paused:我开始播放时