Re: MPMoviePlayerController
Re: MPMoviePlayerController
- Subject: Re: MPMoviePlayerController
- From: Jeffrey Walton <email@hidden>
- Date: Wed, 13 Apr 2011 18:01:02 -0400
On Wed, Apr 13, 2011 at 3:12 PM, Kyle Sluder <email@hidden> wrote:
> 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:
>>>
[ SNIP ]
>>>
>>
>> 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.
:)
I'm registered for the following notifications:
* MPMoviePlayerPlaybackDidFinishNotification (0)
* MPMoviePlayerPlaybackDidFinishReasonUserInfoKey (1)
* MPMoviePlayerPlaybackStateDidChangeNotification (2)
* MPMoviePlayerLoadStateDidChangeNotification (3)
* MPMoviePlayerThumbnailImageRequestDidFinishNotification (4)
Here's what I am seeing (I'm logging in the notification). The double
MPMoviePlayerLoadStateDidChangeNotification is the Start/Stop sequence
from the player. The stop comes immediately. (I've also tried with a
filename which has no embedded spaces). Notice that
MPMoviePlayerPlaybackDidFinish* is never received.
2011-04-13 16:48:41.725 MyTestApp[364:707] Filename:
/var/mobile/Applications/82D7D326-A6FA-4DE9-8DB9-D703C5F3DCB9/Documents/02
Lost Verizon.m4v
...
[Switching to thread 13315]
2011-04-13 16:48:42.671 MyTestApp[364:707] Notification:
NSConcreteNotification 0x1735d0 {name =
MPMoviePlayerLoadStateDidChangeNotification; object =
<MPMoviePlayerController: 0x1e8f20>}
2011-04-13 16:48:42.677 MyTestApp[364:707] Notification:
NSConcreteNotification 0x16ade0 {name =
MPMoviePlayerPlaybackStateDidChangeNotification; object =
<MPMoviePlayerController: 0x1e8f20>}
Unfortunately, according to the documentation for
MPMoviePlayerPlaybackStateDidChangeNotification: "There is no
userInfo". It kind of takes the wind out of the sails for fetching
MPMovieFinishReasonPlaybackError from the dictionary.
Jeff
_______________________________________________
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