Tag: mpmovieplayercontroller

通过MPMoviePlayer传输具有凭据的大型电影

我一直在尝试从受保护的URLstream式传输电影。 我可以下载电影然后播放,但电影太长,所以这是烦人的。 这是我的代码: -(MPMoviePlayerController *)moviePlayerController { NSURL *url = [NSURL URLWithString:@"http://ABcDE.com/secret/Movie.mov"]; _moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; NSURLCredential *credential = [[NSURLCredential alloc] initWithUser: @"user" password: @"password" persistence: NSURLCredentialPersistencePermanent]; NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost: [url host] port: 80 protocol: [url scheme] realm: [url host] authenticationMethod: NSURLAuthenticationMethodDefault]; [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential: credential forProtectionSpace: protectionSpace]; _moviePlayer.view.frame = CGRectMake(0, 0, […]

MPMoviePlayerController 5秒后停止播放video

我试图在iOS上播放video,但只播放了5个video。 这是我的代码: NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"videoviewdemo" ofType:@"mp4"]; NSURL *movieURL = [[NSURL alloc]initFileURLWithPath:moviePath]; MPMoviePlayerController *theMoviPlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; theMoviPlayer.controlStyle = MPMovieControlStyleFullscreen; theMoviPlayer.controlStyle = MPMovieControlStyleDefault; [theMoviPlayer setMovieSourceType:MPMovieSourceTypeFile]; theMoviPlayer.shouldAutoplay = YES; theMoviPlayer.view.transform = CGAffineTransformConcat(theMoviPlayer.view.transform, CGAffineTransformMakeRotation(M_PI_2)); [theMoviPlayer.view setFrame:self.view.frame]; [theMoviPlayer prepareToPlay]; [self.view addSubview:theMoviPlayer.view];

iOS MPMovieplayer控制器风格的问题

我已经创build了一个VideoPlayer / VideoEditor,我可以使用select器视图控制器从设备内存中select一个video。 下面的图片展示了在播放video的时候如何显示search栏, 这是一个与相应的形象寻求酒吧 之后select一个图片,我已经使用MPMoviePlayerController选定的url, player = [[MPMoviePlayerController alloc]initWithContentURL:[info objectForKey:@"UIImagePickerControllerMediaURL"]]; player.controlStyle = MPMovieControlStyleEmbedded; 但是显示寻找像一个共同的节目 , 我想要一个像上面那样的对应图像的search栏。 不是低于一个。 这是可能的, 任何图书馆可以做到这一点? 提前致谢。

将自定义控件添加到全屏幕电影

是否有可能将自定义控件添加到以全屏模式播放的电影(使用MPMoviePlayerController)? 我已经在几个stream媒体应用中看到了这个,我很好奇它是如何完成的。

如何在iOS中播放.m3u8或.ts文件?

我在xCode 4.5.1创build了一个iOS应用xCode 4.5.1 。 这个应用程序的主要目的是播放.m3u8video文件。 我已经在我们的本地资源包中添加了一个.m3u8文件和所有的段(.ts)。 那么,如何在iPhone上使用MPMoviePlayerController或UIWebView在本地播放这个文件呢? 而且,我们可以修改或不从服务器下载后的文件? 如果可能的话怎么做? 请告诉我,任何一个知道…

与AVAudioPlayer同步播放MPMoviePlayerController

我正在尝试添加一个电影到游戏的介绍。 这部电影没有声音/音乐。 不过,我确实在背景中有音乐循环。 音乐是有点特定的,因为音乐的介绍和电影一样长,然后节奏快一点。 在iPod 4G这样的设备上,我遇到的问题太快了,这就基本上破坏了电影序列。 这在我的iPhone 4S中不会发生。 我试图寻找某种电影开始播放的通知,然后开始播放音乐。 我一直不成功。 这是我到目前为止: -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"SplashVideo" ofType:@"mp4"]]]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:player]; [[player view] setFrame:CGRectMake(0, 0, 480, 320)]; [player setControlStyle:MPMovieControlStyleNone]; [[self view] addSubview:[player view]]; // play movie [player play]; //musicPlayer is defined in the header [self […]

NSInvalidArgumentException“无法识别的select器发送到实例”(使用MPMoviePlayerController)

那么,我有一个具有DetailViewController的RootViewController中的TableView,用于显示单个logging的信息。 在详细信息页面我必须播放一个多媒体文件,并使用框架MediaPlayer,根据本指南: http : //www.techotopia.com/index.php/Video_Playback_from_within_an_iOS_4_iPhone_Application 似乎一切都好,但是当我点击播放button时,我有这个错误: -[DetailsViewController playmovie]: unrecognized selector sent to instance 0x9117f60 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DetailsViewController playmovie]: unrecognized selector sent to instance 0x9117f60' 这些是我的文件: 在AppDelegate中,我使用这个导航控制器: […] // Create a table view controller RootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain]; rootViewController.managedObjectContext = context; rootViewController.entityName = @"Porti"; UINavigationController *aNavigationController = […]

selectvideo的UIImagePickerController可以防止MPMoviePlayerViewController实例工作

我有一个viewcontroller在一个popOver呈现UIImagePickerController 。 如果用户select一个video,然后closurespopup窗口,并移动到下一个“页面( 视图控制器 )”,并尝试使用该页面上的MPMoviePlayerViewController播放任何电影,他们不能这样做。 我相信发生的事情是在图像select器中显示的播放器被保留,因此这个新的video不能播放。 我已经正确地解散了popover,并且在尝试播放video时没有收到任何错误。 有没有人遇到过这样的事情? iOS SDK 4.2 iPad 。

声明失败:电影播放器​​启动状态错误(1)

我正在一个iPad应用程序中播放一个video(m4v),然后转到另一个video控制器播放另一个video。 它玩的很好,但是当第二个video完成播放,然后抛出断言失败。 错误是: *** Assertion failure in -[MPMoviePlayerControllerNew _moviePlayerDidBecomeActiveNotification:], /SourceCache/MobileMusicPlayer_Sim/MobileMusicPlayer-1137.39/SDK/MPMoviePlayerController.m:1236 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'movie player <MPMoviePlayerControllerNew: 0x623f6b0> has wrong activation state (1)' *** Call stack at first throw: ( 0 CoreFoundation 0x015e35a9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x01737313 objc_exception_throw + 44 2 CoreFoundation 0x0159bef8 +[NSException raise:format:arguments:] + 136 3 […]

MPMoviePlayerController给我一个黑色的空视图,没有video播放

iOS 5.1,这里是代码: MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString:@"map.mp4"]]; [player prepareToPlay]; [player.view setFrame: self.view.bounds]; // player's frame must match parent's [self.view addSubview: player.view]; // … [player play]; 其实这跟苹果说的一样,但是当我点击button来使用这个function的时候,只有一个黑色的Rectangle呆在那里,没有video播放,没有声音发生,也没有暗恋,所以我想知道如何做这个工作