views:

746

answers:

1

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?
A: 

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.

Cirrostratus
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