Skip to content

Commit

Permalink
Missing iOS 3.2 MPMoviePlayer methods and properties
Browse files Browse the repository at this point in the history
prepareToPlay
backgroundView
shouldAutoplay
  • Loading branch information
hpique committed Jul 13, 2012
1 parent 69680cf commit 69a2463
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions MediaPlayer/Classes/MPMediaPlayback.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- (void)play;
- (void)pause;
- (void)prepareToPlay;
- (void)stop;

@end
9 changes: 9 additions & 0 deletions MediaPlayer/Classes/MPMoviePlayerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,20 @@ extern NSString *const MPMovieDurationAvailableNotification;
@property (nonatomic, copy) NSURL *contentURL;
@property (nonatomic) MPMovieControlStyle controlStyle;
@property (nonatomic) MPMovieSourceType movieSourceType;

// A view for customization which is always displayed behind movie content.
@property(nonatomic, readonly) UIView *backgroundView;

@property (nonatomic, readonly) MPMoviePlaybackState playbackState;
@property (nonatomic) MPMovieRepeatMode repeatMode;

// Indicates if a movie should automatically start playback when it is likely to finish uninterrupted based on e.g. network conditions. Defaults to YES.
@property(nonatomic) BOOL shouldAutoplay;

@property (nonatomic, readonly) NSTimeInterval duration;
@property (nonatomic) MPMovieScalingMode scalingMode;


- (id)initWithContentURL: (NSURL*)url;

@end
19 changes: 19 additions & 0 deletions MediaPlayer/Classes/MPMoviePlayerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ @implementation MPMoviePlayerController
@synthesize contentURL=_contentURL;
@synthesize controlStyle=_controlStyle;
@synthesize movieSourceType=_movieSourceType;
@synthesize backgroundView;
@synthesize playbackState=_playbackState;
@synthesize repeatMode=_repeatMode;
@synthesize shouldAutoplay;
@synthesize scalingMode=_scalingMode;


Expand Down Expand Up @@ -233,6 +235,11 @@ - (void)pause
_playbackState = MPMoviePlaybackStatePaused;
}

///////////////////////////////////////////////////////////////////////////////
//
- (void)prepareToPlay {
// Do nothing
}

///////////////////////////////////////////////////////////////////////////////
//
Expand All @@ -242,4 +249,16 @@ - (void)stop
_playbackState = MPMoviePlaybackStateStopped;
}

#pragma mark - Pending

- (void) setShouldAutoplay:(BOOL)shouldAutoplay {
NSLog(@"[CHAMELEON] MPMoviePlayerController.shouldAutoplay not implemented");
}

- (UIView*) backgroundView {
NSLog(@"[CHAMELEON] MPMoviePlayerController.backgroundView not implemented");
return nil;
}


@end

0 comments on commit 69a2463

Please sign in to comment.