MPMoviePlayerController在ios 12.2中不起作用

时间:2019-04-09 07:47:49

标签: ios swift mpmovieplayercontroller ios12

我更新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:我开始播放时

0 个答案:

没有答案