Contents

MPMoviePlayerPlaybackDidFinish

Posted when a movie has finished playing.

Declaration

static let MPMoviePlayerPlaybackDidFinish: NSNotification.Name

Discussion

The userInfo dictionary of this notification contains the MPMoviePlayerPlaybackDidFinishReasonUserInfoKey key, which indicates the reason that playback finished. This notification is also sent when playback fails because of an error.

The movie player whose state has changed is available as the object associated with the notification.

This notification is not sent when a movie is displaying in fullscreen mode and the user taps Done. The Done button pauses playback and causes the movie player to exit fullscreen mode. To detect this scenario, register for other notifications such as MPMoviePlayerDidExitFullscreen.

See Also

MediaPlayer