Re: MPMoviePlayerController
Re: MPMoviePlayerController
- Subject: Re: MPMoviePlayerController
- From: Kyle Sluder <email@hidden>
- Date: Wed, 13 Apr 2011 12:12:53 -0700
On Wed, Apr 13, 2011 at 11:39 AM, Jeffrey Walton <email@hidden> wrote:
> On Wed, Apr 13, 2011 at 1:26 PM, Kyle Sluder <email@hidden> wrote:
>> On Apr 13, 2011, at 9:15 AM, Jeffrey Walton <email@hidden> wrote:
>>
>>>
>>>
>>> Unfortunately, PLAY is not documented [2]. In addition, I can't find a
>>> delegate (as with other controllers) and there are no notifications
>>> covering errors [2]. Finally, the error log is for network streams
>>> [2].
>>
>> Not sure about the error handling, but MPMoviePlayerController is documented to conform to MPMediaPlayback, the documentation for which describes -play: http://developer.apple.com/library/ios/documentation/mediaplayer/reference/MPMediaPlayback_protocol/Reference/Reference.html#//apple_ref/occ/intfm/MPMediaPlayback/play
> Silly me. I went looking for documentation on MPMoviePlayerController
> PLAY in MPMoviePlayerController's documentation.
Well, the MPMoviePlayerController documentation's Overview section
does say the following:
"This class supports programmatic control of movie playback, and
user-based control via buttons supplied by the movie player. You can
control most aspects of playback programmatically using the methods
and properties of the MPMediaPlayback protocol, to which this class
conforms. The methods and properties of that protocol let you start
and stop playback, seek forward and backward through the movie’s
content, and even change the playback rate."
> The great thing about an immediate return code (followed by a call to
> GetLastError or errno) is one can find the point of first failure
> quickly, without disgorging the point of failure from the reporting
> mechanism. There's a lot to be said about finding the point of first
> failure quickly.
Except when that error happens in a background task. You certainly
wouldn't want -play to block until the user stopped playback or an
error occurred.
>
> MPMoviePlayerPlaybackDidFinishNotification " ... is also sent when
> playback fails because of an error." So how does one tell when the
> notification is sent for a good reason, versus a bad reason? As can be
> seen, the documentation does not clarify. Its too bad there is no
> 'MPMoviePlayerError' (or similar) notification (perhaps I'm reading
> the notification section incorrectly).
The sentence directly before the one you quoted: "The userInfo
dictionary of this notification contains the
MPMoviePlayerPlaybackDidFinishReasonUserInfoKey key, which indicates
the reason that playback finished." Click the link, it takes you to
the documentation for that notification key, which states "The value
of this key is an NSNumber containing an integer value that represents
one of the “MPMovieFinishReason” constants." Click that link, you get
the three values: MPMovieFinishReasonPlaybackEnded,
MPMovieFinishReasonPlaybackError, MPMovieFinishReasonUserExited.
Not that difficult.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden