简体   繁体   中英

How can i show notification when video did finish?

I am working on project that play a video. And i want to show a notificaiton like:"Did you like video?". How can i know the video has finished? Is there any delegate method or etc for this? Thanks so much.

from Apple doc:

MPMoviePlayerPlaybackDidFinishNotification

Posted when a movie has finished playing. 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 MPMoviePlayerDidExitFullscreenNotification.

Availability Available in iOS 2.0 and later. Declared In MPMoviePlayerController.h

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM