0

I am using the UIWebView to load both streaming audio and video. I have properly set up the UIWebView delegate and I am receiving webViewDidStartLoading and webViewFinishedLoading events perfectly. The webview launches a full screen window (likely a MPMoviePlayerController)

Apple's MoviePlayer example gets the array of Windows to determine which window the moviePlayerWindow is for adding custom drawing/getting at the GUI components. I believe this to be a bad practice/hack.

My expectation is that I should be able to figure out when that button was clicked by either a delegate method or an NSNotification. It may also be the case that I have to poke around subviews or controllers with isKindOf calls, but I don't think those are correct approaches.

  1. Are my expectations incorrect, and if so, why?
  2. What is the correct way to bind an action to that "Done" button?
David Sowsy
  • 1,680
  • 14
  • 13

2 Answers2

0

There isn't an MPMoviePlayer instance method that covers this. You can use - (void) moviePlayBackDidFinish:(NSNotification*)notification to find out when the movie has finished. Or you could overlay the existing Done button with your own and have complete control that way.

james_womack
  • 10,028
  • 6
  • 55
  • 74
  • It seems the moviePlayBackDidFinish doesn't get the events associated with the webview. Overlaying a clear button will do what I want (at least for English), but will immediately break with a UI change from Apple. – David Sowsy Jan 30 '10 at 15:10
0

You can also use MPMoviePlayerWillExitFullscreenNotification in order to conrol the action provided that youe MoviePlayer is in fulscreen mode.

Aditya Athavale
  • 183
  • 3
  • 12
  • I am also having the same problem, but this notification will be called when user taps the full screen enter/exit button. I want to perform a task specifically on the hit of Done button. – Anshul Oct 20 '11 at 04:08