Created
February 2, 2010 21:19
-
-
Save neror/293040 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void)playMovieAtURL:(NSURL*)theURL { | |
| MPMoviePlayerController* theMovie = [[MPMoviePlayerController alloc] initWithContentURL:theURL]; | |
| theMovie.scalingMode = MPMovieScalingModeAspectFill; | |
| theMovie.movieControlMode = MPMovieControlModeHidden; | |
| // Register for the playback finished notification. | |
| [[NSNotificationCenter defaultCenter] addObserver:self | |
| selector:@selector(myMovieFinishedCallback:) | |
| name:MPMoviePlayerPlaybackDidFinishNotification | |
| object:theMovie]; | |
| // Movie playback is asynchronous, so this method returns immediately. | |
| [theMovie play]; | |
| UIWindow *movieWindow = [[UIApplication sharedApplication] keyWindow]; | |
| UILabel *label = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; | |
| label.textColor = [UIColor whiteColor]; | |
| label.transform = CGAffineTransformMakeRotation(M_PI/2.0); | |
| label.frame = CGRectMake(290.f,0.f,30.f,480.f); | |
| label.backgroundColor = [UIColor colorWithRed:0.f green:0.f blue:0.f alpha:.5f]; | |
| label.text = @"Can you see me?"; | |
| [movieWindow addSubview:label]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment