mpmovieplayercontroller

MPMoviePlayerController will play once, then throw an error

坚强是说给别人听的谎言 提交于 2019-12-24 10:44:54
问题 I realise that a similar question has been posted before, but I really can't seem to find a solution that works for me. I have a MoviePlayer class which stores an ivar of MPMoviePlayerController, and I have the following method in the class: -(void)playMovie:(NSString *)movieName { NSURL *movieURL; NSBundle *bundle = [NSBundle mainBundle]; if(bundle) { NSString *moviePath = [bundle pathForResource:movieName ofType:@"m4v"]; if(moviePath) { movieURL = [NSURL fileURLWithPath:moviePath]; } }

Fading out MPMoviePlayerController controls

送分小仙女□ 提交于 2019-12-24 09:58:23
问题 When I start a movie in a MPMoviePlayerController, controls stay at the top for few seconds. After that, they fade out. I want simulate this effect when I use MPMovieControlStyleNone in controlStyle property, but controls disappear abruptly. I tried to use animations without success with the following code: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.50f]; self.myMoviePlayer.controlStyle = MPMovieControlStyleNone; [UIView commitAnimations]; Someone have any idea

MPMoviePlayerController movie length

安稳与你 提交于 2019-12-24 05:20:43
问题 The question is - how to get the movie length from MPMoviePlayerController object? I need this to create a progress bar. I have the method [myPlayer currentTime] to move progress bar while movie is playing. And the [myPlayer setCurrentTime: doubleVal] to rewind the movie. But I can't use all this without information about movie length, or movie end time. Also, maybe exists another player to use in iPhone, instead of MPMoviePlayerController ? 来源: https://stackoverflow.com/questions/1188543

MPMoviePlayer sound working in Simulators and ipad device, but not Working in iPhone Device

こ雲淡風輕ζ 提交于 2019-12-24 05:01:45
问题 I have a problem with MPMoviePlayerController, i.e. I am playing the live stream url in (m3u8 format) MPMoviePlayer like below: player = [[MPMoviePlayerController alloc] initWithContentURL:audioUrl]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:player]; if ([player respondsToSelector:@selector(loadState)]) { // Set movie player layout [player setMovieSourceType:MPMovieSourceTypeStreaming]

nsinvalidargumentexception' reason 'an avplayeritem cannot be associated with more than one instance of avplayer'

≡放荡痞女 提交于 2019-12-24 04:10:43
问题 I am using MPMoviePlayerController for play video and in this I used custom seek bar to jump video. but when I continuously do the seeking forward and rewind then application crashed and throw below error: nsinvalidargumentexception' reason 'an avplayeritem cannot be associated with more than one instance of avplayer' So please suggest. Thanks 回答1: Had same issue, try setting ContentURL after Setting the SourceType like below, moviePlayerController_ = [[MPMoviePlayerViewController alloc] init

MPMoviePlayerController stops playing the video after 5s

末鹿安然 提交于 2019-12-24 03:38:07
问题 I tried to play a video in iOS but it just played 5s for any video. This is my code: 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;

MPMoviePlayerController doesn't play newly saved video file

拈花ヽ惹草 提交于 2019-12-24 02:48:09
问题 I'm using an imagePickerController to record video. In the imagePickerController:didFinishPickingMediaWithInfo: function I'm trying to set the video to a previously defined MPMoviePlayerController: if ([mediaType isEqualToString:(NSString *)kUTTypeMovie]){ NSURL *movieUrl = [info objectForKey:UIImagePickerControllerMediaURL]; [self.moviePlayer setContentURL:movieUrl]]; } This is working fine and the video is indeed playing. But I want to save the file for later use. When I do this and use the

How to Open Youtube video in MPMoviePlayerController and Play it

人走茶凉 提交于 2019-12-23 23:11:46
问题 i use this method before 1 time. but Now i can not get video from this URL that direct-play YouTube video in MPMoviePlayerController. URL = http://www.youtube.com/watch?v=JPUWNcGDyvM&feature=player_embedded - (void)viewDidLoad { player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.youtube.com/watch?v=JPUWNcGDyvM&feature=player_embedded"]]]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector

MPMoviePlayerContentPreloadDidFinishNotification does not fire [iPhone]

别来无恙 提交于 2019-12-23 19:07:30
问题 I'm running into a problem with the MPMoviePlayerContentPreloadDidFinishNotification notification. I've regisered to recieve the MPMoviePlayerContentPreloadDidFinishNotification notification and MPMoviePlayerPlaybackDidFinishNotification but the first one never fires. Is this bug in Firmware OS 3.0 ? maybe fixed in 3.1 ? or ? Because my divice and similator is 3.0 maybe this is a bug ? My code : ... [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name

NSInvalidArgumentException “Unrecognized selector sent to instance” (using MPMoviePlayerController)

给你一囗甜甜゛ 提交于 2019-12-23 12:26:13
问题 Well, I have a TableView in a RootViewController with a DetailViewController for the display of the information of the single record. In the Detail page i have to play a multimedia file and i'm using the framework MediaPlayer, according to this guide: http://www.techotopia.com/index.php/Video_Playback_from_within_an_iOS_4_iPhone_Application it seems all ok, but when i click on the play button i have this error: -[DetailsViewController playmovie]: unrecognized selector sent to instance