Created
October 13, 2011 03:44
-
-
Save kevinejohn/1283313 to your computer and use it in GitHub Desktop.
iOS non-fullscreen video player
This file contains 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
#import <MediaPlayer/MediaPlayer.h> | |
// Add MediaPlayer framework | |
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(20, 60, 200, 200)]; | |
NSURL *movieUrl = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; | |
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl]; | |
//player.view.frame = CGRectMake(50, 50, 200, 200); | |
player.wantsFullScreenLayout = NO; | |
player.moviePlayer.controlStyle = MPMovieControlStyleEmbedded; | |
[v addSubview:player.view]; | |
//[self presentMoviePlayerViewControllerAnimated:player]; | |
[player.moviePlayer play]; | |
[self.view addSubview:v]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment