Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube dismissal event (iOS)

Good day,

Through the use of an UIWebview I have now a working method to show a youtube video within my app (using the tag, finding the play button within the webview and firing the touch event on that).

Works like a charm. The video pops up and plays. However I would like to recieve an event when the video ends or the user clicks the done button.

On the internet I have found that there is an event: MPAVControllerItemPlaybackDidEndNotification where you can listen to. However this one does not get called.

After some further research I found that for Youtube Videos embedded through UIWebView another notification was called ( UIMoviePlayerControllerDidExitFullscreenNotification ). Unfortunately that one does not work either anymore. ( found it here )

Does anyone have any idea how I can do some action after the video is done playing or has been dismissed?

Thanks

like image 294
Matthijn Avatar asked Oct 08 '22 00:10

Matthijn


1 Answers

Use the UIMoviePlayerControllerWillExitFullscreenNotification for getting notified once the user tapped on the DONE button. The UIMoviePlayerControllerDidExitFullscreenNotification seems indeed to be omitted on iOS6.

Mind that ...Did... vs. ...Will... difference!

For more on that subject, once again check my updated answer within that posting you referenced in your question.

like image 163
Till Avatar answered Oct 19 '22 14:10

Till