• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
txt file renamed to mp3, MPMoviePlayerPlaybackDidFinishReasonUserInfoKey returning 0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

txt file renamed to mp3, MPMoviePlayerPlaybackDidFinishReasonUserInfoKey returning 0


  • Subject: txt file renamed to mp3, MPMoviePlayerPlaybackDidFinishReasonUserInfoKey returning 0
  • From: Devarshi Kulshreshtha <email@hidden>
  • Date: Thu, 03 Oct 2013 18:04:38 -0500

I am trying to identify if a file can be played in MPMoviePlayer or not,
for this I have added below code in viewDidLoad:

    [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:_fileDisplayMoviePlayer];

and defined it like this:

    - (void)moviePlayBackDidFinish:(NSNotification*)notif
    {
    NSNumber* reason = [[notif userInfo]
objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
    switch ([reason intValue]) {
        case MPMovieFinishReasonPlaybackEnded:
            NSLog(@"Playback Ended");
            break;
        case MPMovieFinishReasonPlaybackError:
            NSLog(@"Playback Error");
            [self performSelector:@selector(CorruptVideoAlertView)
withObject:nil afterDelay:1.0];
            break;
        case MPMovieFinishReasonUserExited:
            NSLog(@"User Exited");
            break;
        default:
            break;
    }

To verify it, I used below test case scenario:

I changed the extension of .rtf file to .mp3, and tried to play it
in player.

Though notification was invoked, it returned reason as -
MPMovieFinishReasonPlaybackEnded. It should have returned -
MPMovieFinishReasonPlaybackError.

Please suggest how can I test the above scenario, and get the expected
result.
_______________________________________________

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


  • Follow-Ups:
    • Re: txt file renamed to mp3, MPMoviePlayerPlaybackDidFinishReasonUserInfoKey returning 0
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Can I create a thread with a runloop and a dispatch queue?
  • Next by Date: Re: Can I create a thread with a runloop and a dispatch queue?
  • Previous by thread: Re: Throttling iOS 7 event callbacks
  • Next by thread: Re: txt file renamed to mp3, MPMoviePlayerPlaybackDidFinishReasonUserInfoKey returning 0
  • Index(es):
    • Date
    • Thread