mpmovieplayercontroller

iOS 7 MPMoviePlayerController seek forward button brings the video to the End and displays Black screen

寵の児 提交于 2019-12-05 01:26:55
I am facing an issue with MPMoviePlayerController in iOS 7. I enter the fullscreen and then click (just a single tap) on seek forward button (>>|) , and the video playback ends and gives a black screen with a text "Loading" on the header. I registered notification for " MPMoviePlayerPlaybackStateDidChangeNotification ". **[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:self.player];** It does not get fired on a single click of seek forward button. Also on registration of "

player.duration shows always zero in MPMoviePlayerController for video file

柔情痞子 提交于 2019-12-05 01:01:58
I am playing a small video in mpmediaplayer controller using this code MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:videostr]]; where videostr is path of that video file. Now i need to get length of that video file for that i am using this code. length = player.duration; But it always shows 0.000. But the video is playing well. I am checking by googling every where code to get video duration is player.duration only. And i try some other code also AVURLAsset *asset = [[[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:videostr]

Cache Progressive downloaded content in MPMoviePlayerController

筅森魡賤 提交于 2019-12-05 01:01:49
I have a music player implemented in iphone (sdk 4) and it works both with streaming of Mp3 (Transcoded on the fly) or raw progressive download. Is there anyway to make the progressivedownloaded content (which I dont directly control) to be cached so it doesn redownload the whole content? Or Is there a global cache setting to control? (On a side note, I used ASIHTTP APIs to contact my HTTP server and access data that does allow caching). Thanks in advance. You can use NSURLConnection to save the file and play it back. Example: -(void)downloadFileAtPath:(NSString *)path { NSURL *url = [NSURL

MPMoviePlayerController background audio issue in iOS5

十年热恋 提交于 2019-12-05 00:29:12
问题 I have an App that does the pretty standard operation: It plays audio (streamed or in filesystem) when the app is in 1) Foreground mode, 2) Screen locked state 3)Background mode. This was working fine in all iOS prior to iOS5. I have been using MPMoviePlayerController (Because it can play streamed and local file system audio) I have the following setup: info.plist has Background Mode set to "Audio" I have Audiosession setup as shown at http://developer.apple.com/library/ios/#qa/qa1668/_index

how to add text on video in iPhone

别说谁变了你拦得住时间么 提交于 2019-12-04 21:02:22
I want to add a text or string ON the video being played by MPMoviePlayerViewController in a way that it becomes part of the video being played. So that, when I post that video on Facebook or Twitter the text must be shown above the video. For this I have tried getting all the frames of the video and then write text on each of those frames and then again make a video of all those frames. But this way, I am getting memory issues and it crashes on the device. - (NSArray*)getVideoFramesFromMovieController:(MPMoviePlayerViewController*)mpMoviePlayerVC { NSLog(@"Getting frames from a video asset.")

MPMoviePlayerController : orientation problem

妖精的绣舞 提交于 2019-12-04 20:26:15
finally I have to post my problem here. Yes it could be duplicate question here as I have referred many answers regarding to this question.But I could not find any fix. (Also didn't find any question regarding to tab-bar app specific so...) And I don't want to use MPMoviePlayerViewController I have tab-bar application. In last tab's VC there is a button. On click event I want to start movie player. For that I am using MPMoviePlayerController . Its all fine when orientation is Portrait . But regarding to changes, now I have to play it in landscape mode only. here is my code : -(void)playMovie {

MPMoviePlayerController not working in iOS4

别来无恙 提交于 2019-12-04 19:29:07
I'm using the first answer from iOS 4 + MPMoviePlayerController to try and get MPMoviePlayerController to play. In the simulator (iPhone device with iOS4), I hear sound but no video. On the device (iPhone 3GS and iOS4), I don't get anything. Here's my code: MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; if ([moviePlayer respondsToSelector:@selector(view)]) { moviePlayer.controlStyle = MPMovieControlStyleFullscreen; [moviePlayer.view setFrame:self.view.bounds

Download video before view Iphone sdk

纵饮孤独 提交于 2019-12-04 19:02:04
I am developing an application that requires to play some video. However I do not want to pack the videos with application. Instead I would like to download videos in the NSDocumentDirectory and then play from there using MPMoviePlayerController. Anybody any Idea how could I download the video from a url? Thanx, Gezim Try this one: NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setHTTPMethod:@"GET"]; NSError *error; NSURLResponse *response; NSString *documentFolderPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSFileManager

Find out if MPMoviePlayerController is currently playing

限于喜欢 提交于 2019-12-04 18:25:48
问题 I have one small problem regarding MPMoviePlayerController, i have a link that play movie when i click on that movie button, however when i click on another button the application gets crashed, i need to find how to identify that movie is playing or getting any kind of response 回答1: To expand on @Saurabh's answer you can check if the video is playing by if(player.playbackState == MPMoviePlaybackStatePlaying) { // is Playing } where MPMoviePlaybackState is defined as enum {

iphone - MPMoviePlayerController - How can I decrease volume of the video programmatically

大憨熊 提交于 2019-12-04 17:18:38
I'm using MPMoviePlayerController to play a video which has audio as well. It's working fine. I'm hiding the default controls. So no controls are showing on the video. I want to place a slider on the video (I successfully placed a slider as well over the video). With the slider, I want to control the volume of the video that is being played. How can I control volume of video? See the documentation for MPVolumeView. Here is a sample code that I use in my view controller. MPVolumeView *systemVolumeSlider = [[MPVolumeView alloc] initWithFrame: CGRectMake(10, 10, 200, 40)]; [self.view addSubview: