I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that:
You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms.
Except just above in the header here: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html it doesn't seem to.
All I want to do is slow down the playback rate for a video.
That protocol is only available in iPhone OS 3.2 and later, which is currently only for iPad.
You should check the Availability section with a lot of the newer classes' methods since there are two platforms now.
Related
Is there a way to make MPMusicPlayerController buffer content before I call -play? Or does it do this by default when you set a queue? AVAudioPlayer has the -prepareToPlay method and I've heard that AVQueuePlayer starts buffering the next item automatically, but does MPMusicPlayerController have the same behaviour?
The answer to this question is in the iOS 6 beta docs, if anyone is wondering. Can't say much more because of NDA.
EDIT: As requested, since the NDA has been lifted, here's the answer: As of iOS 6, MPMusicPlayerController, like MPMoviePlayerController implements the MPMediaPlayback protocol, which has methods like -prepareToPlay.
Is there any way to show subtitules on a movie loaded by MPMoviePlayerViewController by default?? The movie has subs embed in the video.
Thank you!
Unfortunately this feature is missing in the MPMoviePlayer playback classes. This is obviously rather annoying, and you should consider filing a feature request with Apple. You can use the AVPlayer class instead, which as a .closedCaptionDisplayEnabled property: the downside is it's somewhat more complicated to use and only available on iOS 4.0+.
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;
hopefully someone has an answer - I am searching now for hours.
I want to get the position of an movie.
I tried it with MPMoviePlayerController, but this class doesn't support the MPMediaPlayback property called "currentPlaybackTime".
(the funny thing is, that the MP Music PlayerController has this property)
Therefore I can't get the position in my video. Is there another way to do it???
Thank you very much in advance!
MPMoviePlayerController conforms to the MPMediaPlayback protocol, and does have a currentPlaybackTime property available. However, I believe that the currentPlaybackTime property was introduced in 3.2, so it may not be available to you if you're trying to develop on a pre-3.2 device.
Is it possible to load a short video file and - once loaded - select a specific frame and display that frame in a view? If there is no native support for this, how about an open source alternative?
Thanks in advance.
-Doug
I think that in iphone programming you're stuck with the fullscreen video solution proposed by apple. You could write your own controller to do it differently, but i think it could be difficult to achieve good performances and you're cut out of the app-store for sure.
edit:
looks like in iphone sdk 3.2 apple added something for you:
The MPMoviePlayerController class
defines an interface for managing the
playback of a movie. Playback occurs
either in full-screen mode or in a
custom view that is vended by the
movie player controller. You can
incorporate the view into your own
view hierarchies or use a
MPMoviePlayerViewController object to
manage the presentation for you.
and again
Behavior in iPhone OS 3.1 and Earlier
In iPhone OS 3.1 and earlier, this
class implemented a full-screen movie
player only. After creating the movie
player and initializing it with a
single movie file, you called the play
method to present the movie. (The
definition of the play method has
since moved out of this class and into
the MPMediaPlayback protocol.) The
movie player object itself handled the
actual presentation of the movie
content.
i haven't tested it yet but have a look at the official documentation under MPMoviePlayerController Class Reference, it may help.