mpmoviewcontroller

Dismiss MPMoviePlayerViewController on play error

只谈情不闲聊 提交于 2019-12-30 05:14:05
问题 I have a problem with the MPMoviePlayerViewController: If the controller can't find the movie at the specified URL it displays a white screen and I can't make it go close. This is how I start the movie player: - (void) playVideo:(NSString*)path { NSURL* url = [NSURL URLWithString:path]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; double osversion = [[[UIDevice currentDevice]

playableDuration returns 0 in iOS5

隐身守侯 提交于 2019-12-11 08:40:37
问题 Has anyone else noticed that playableDuration property of MPMoviePlayerController class always returns 0 in iOS 5. This used to work fine in previous versions of iOS. I use it to set the value of a progress bar. Here is piece of code that used to work under 4.x SDK just fine (i.e., the playableDuration attribute returned the correct non-zero value while buffering the stream), but under SDK 5.x it always returns zero. - (void) updateMeter { NSLog(@"playableDuration = %f", streamPlayer

want to hide progressbar which comes on top in navigation bar of MPMoviePlayerController

◇◆丶佛笑我妖孽 提交于 2019-12-08 07:41:06
问题 Is there any way to hide progress bar which comes on top in navigation bar of MPMoviePlayerController? I want to hide because I do not want user to forward/backward the video. However, User can exit it by clicking on DONE button. 回答1: Since the scrubber is available both in the Embedded and the FullScreen version of the MPMovieControlStyle the only solution I see is to use MPMovieControlStyleNone and overlay your own version of the Done button on top of the Movie playback view. 来源: https:/

MPMoviePlayerViewController won't play movie, start and closes immediately

偶尔善良 提交于 2019-12-08 04:30:02
问题 I'm trying to play a video with MPMoviePlayerViewController, I present the MPMoviePlayerViewController but after 1 second he is dismissing itself. This is my code: .h: #import <MediaPlayer/MediaPlayer.h> @property (strong, nonatomic) MPMoviePlayerViewController *moviePlayerViewController; .m: - (void)playmovie { NSString *databaseName = @"NO.mp4"; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [documentPaths

MPMoviePlayerViewController won't play movie, start and closes immediately

↘锁芯ラ 提交于 2019-12-06 16:24:16
I'm trying to play a video with MPMoviePlayerViewController, I present the MPMoviePlayerViewController but after 1 second he is dismissing itself. This is my code: .h: #import <MediaPlayer/MediaPlayer.h> @property (strong, nonatomic) MPMoviePlayerViewController *moviePlayerViewController; .m: - (void)playmovie { NSString *databaseName = @"NO.mp4"; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [documentPaths objectAtIndex:0]; NSString *databasePath = [documentDir stringByAppendingPathComponent:databaseName];