How to keep MPMoviePlayerController open after movie ended? - iphone

If I use MPMoviePlayerController to play video in my iPhone app, it opens, loads the movie, plays it and then closes. Is it possible to force it to stay open after the movie finishes, so that user can replay it using its controls, instead of using controls in parent view? Also, is it possible to start MPMoviePlayerController in the paused mode?
thanks for any advice.

None of that is possible using the available API in the Pre-3.2 OS. One thing you could do is take a scerenshot of the last frame and stick that behind the movie so when it's done playing, it looks like it's still there, then just stick a button on it to replay. you could make an interface that looks/behaves similar to the standard movie player interface just for the play button if you need to.

For anyone stumbling over this now... There is a way to do this. Check out this question :)

Related

Is it possible to play video continuiusly after go to other view and come back

I have a video on the first view that use 'MPMoviePlayerController'. I declare the video in 'viewDidLoad' method. I need the video play continuously when go to another view and come back. Is it possible? How?
yes it Possibe play video in background mode try this link
Hope it Help You

Is there a way to get the length of a video playing in my UIWebView? Can I start my movie at a certain position?

I think the current answer for iOS 6 and less is NO, but here's my question anyway:
I want to open my movie via a UIWebView at 5 minutes into the video... is this possible?
[webView loadRequest:[NSURLRequest requestWithURL:movie.fileURL]];
I also want to get the time position of the video when the user hits the Done button. Is that possible? I looked at some undocumented notifications and I couldn't find much for this either. See here.
My walk around way to solve what you want is to use another player instead of the UIWebView. Such as MPMoviePlayerController or MPMoviePlayerViewController. Then do what you want is much easier.

MPMoviePlayerController - handle phone call

I'm using MPMoviePlayerController to play a video.
When a call comes, i want to pause and when he completes, i want to continue the video.
I couldn't find relevant solution in my search.
Is this something possible?
Its possible to handle the interruptions using AVAudioSessionDelegate "beginInterruption" and "endInterruption". But when I am setting the session to play back, my movie player sound is not heard at all.
Does any one know the solution?
There is a callEventHandler in Core Telephony framework. I hope, You could find what you want here.
We've to set the session active after endInterruption.

Is it Possible to Have own scrubber for MPMoviePlayercontroller

I want to play videos. I am using MPMoviePlayer, but I don't want to use the controls provided by MPMoviePlayer. So I am trying to create my own custom controls. All the functionality like play, pause, fullscreen, forward, backward are done. The only problem is with the scrubber. I am having one UISlider but I don't know how exactly work with this. How to track the currently playing video time? How to play video from where I will slide the thumb of slider?
If anyone knows this kindly help me in this.
Thanks in advance.
I was having a similar problem. I figured out how to create custom movie controls and put it up on github. Let me know if that helps. Feel free to ask me any questions if you want details.
First, we should note that all of this is possible in iOS 3.2+, if you are OK not to support iOS 3.1.x.
In iOS 3.2+, MPMoviePlayerController implements the MPMediaPlayback protocol, meaning that it responds to play, stop, etc., all the controls you would expect -- sounds like you already have some of this working. Please see the reference for the MPMediaPlayback protocol.
To get the MPMoviePlayerController to stop showing its own controls, do this on initialization:
yourPlayer.controlStyle = MPMovieControlStyleNone;
Finally, to get the scrubber to work, you need to set the UISlider valueChanged: callback to something, and update the value of currentPlaybackTime property. If you want to seek 10 seconds in:
yourPlayer.currentPlaybackTime = 10;

Can't stop movie playback immediately

When you launch a video and IMMEDIATELY press "Done" the MPMoviePlayerController will exit, however the video still plays in the background (you can hear the audio). It works fine if you allow the video to begin playing before you hit the "Done" button.
Does anybody know a workaround for this?
Try calling stop on your MPMoviePlayerController instance when the view controller that spawned the movie receives its viewDidAppear: (or viewWillAppear:) methods
While, so far, I've also found MPMoviePlayerController somewhat erratic, I imagine just releasing the object (after listening to a MPMoviePlayerPlaybackDidFinishNotification) would help.
Update: This seems to be a known 3.0 bug. I was unable to find a workaround
http://www.iphonedevsdk.com/forum/iphone-sdk-development-advanced-discussion/15768-mpmovieplayer-video-via-url-glitch.html