views:

62

answers:

1

HI, i´ve created a new MPMoviePlayerController instance and init that with a contentURL like this:

    player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
    player.view.frame = rect;
    [myView addSubview:player.view];
    [player play];

Although "play" is a instance variable of the "MPMediaplayback", i can´t get the "isPreparedToPlay" property.

EDIT: I´ve read that if i want to use the "MPMediaPlayback"-protocol, i have to add it in my @interface like this:

@interface MyViewController : UIViewController <MPMediaPlayback> 

But how can i use these properties correctly?

Why? Using SDK4.0. Thanks for your time.

A: 

You do not need to add any protocols, the documentation was indicating that the method is part of the MPMediaPlayback protocol (which the MPMoviePlayer object implements).

You should be able to write the following:

BOOL ready = [player isPreparedToPlay];

You may need need a header file.

#import <MediaPlayer/MediaPlayer.h>

Good luck.

Dave