Re: MPMoviePlayerController
Re: MPMoviePlayerController
- Subject: Re: MPMoviePlayerController
- From: Jeffrey Walton <email@hidden>
- Date: Wed, 13 Apr 2011 14:39:02 -0400
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.
>
>> More philosophical: why are the APIs so inconsistent? Why is there no
>> readily apparent way to consistently retrieve error information
>> (Windows has GetLastError and Linux has errno)?
>
> And you've never seen "An error occurred: There was an error (E_SUCCESS)" on Windows, or similar errno stomping on *nix?
It happens at times. My personal experience is that I sometimes log
*before* retrieving the error (the logging succeeds and stomps the
failure code). If you find a program is regularly producing incorrect
results and incorrectly reporting errors, its probably time to
uninstall.
> What UNIX libraries do you regularly use that set errno?
For example, socket calls. Typically, anything less than 0 cause me to
inspect errno. For the visual stuff, I use QT on Linux so an exception
is thrown.
> Returning errors from the place they happen, or providing a block argument that can act as an error handler, or notifying a delegate object than an error has occurred in an operation it requested before are all vastly superior to the "last failure gets to write an oh-so-descriptive integer to a shared memory location."
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.
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).
Below is the rabbit hole I went down trying to play a Movie. I would
give my left arm for a return code right about now. With a error code,
I could search for "MPMoviePlayerController play error 0xXXXXX" and
probably get dozens of questions/answers pertinent to my situation.
Jeff
Purchase TV Show from Apple's iTunes
v
Attempt to play TV show on iPhone
v
UIWebView, loadRequest
v
Use code from a well known author
v
Video fails to play
v
Look up docs on loadRequest
v
Nothing about errors in loadRequest documentation
v
Ask for help to determine loadRequest errors
v
Use webView:didFailLoadWithError:
v
Error is "Plug-in handled load" (sounds a lot like stomping an error
with success)
v
Switch to MPMoviePlayerController
v
Use code from a well known author
v
Video fails to play
v
PLAY is not documented in MPMoviePlayerController
v
Try to locate the error
v
Stack Overflow states errors reported through notifications
v
MPMoviePlayerPlaybackDidFinishNotification is sent for both good and
bad conditions
v
Scratch head and wonder
_______________________________________________
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