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+.
Related
I'm using MPMoviePlayer to stream audio from a podcast and so far it's working great with the exception of the fact that the controls fade out after the audio begins playing as it would when you're watching a movie so I have a few questions:
1) Is it appropriate to use MPMoviePlayer, which seems to really be designed more for video than audio for streaming mp3 files?
2) If so, is there a way to keep the controls from fading out? I'm currently setting the control style:
[player setControlStyle: MPMovieControlStyleEmbedded];
Which appears to be, according to Apple's docs, the correct style to keep the controls on screen.
Is it appropriate to use MPMoviePlayer, which seems to really be designed more for video than audio for streaming mp3 files?
Yes, even though there certainly are other options - have a look at AVPlayer for example. But then again, that won't show any UI at all so the next answer will in any case apply: you will have to build you own UI if you are not satisfied with the one MPMoviePlayerController has to offer (even though in your particular case it is just the fade-out).
If so, is there a way to keep the controls from fading out? I'm currently setting the control style:
No, there is no way to achieve what you are asking for when using the standard UI (no matter if embedded or fullscreen). The only option would be supplying custom controls (while using MPMovieControlStyleNone).
I am streaming a movie to MPMoviePlayerController by simply passing MPMoviePlayerController the URL of the movie file. I am using my own custom controls and would like to create a progress bar to see how much of the video has been buffered (like in YouTube) . But there doesn't seem to be any available data
to create this. Does anyone know how to do this. Thanks.
Prior to iOS 5.x the playableDuration did the job. But since iOS 5 this property seem to always return zero. Give it a try and please let me know if it does work for you.
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;
I am curious about the new APIs for iPhone iOS: AVCapture...
Does this include a documented way to grab a screenshot of the camera preview? The doc seems a bit confusing to me, and since it is out of NDA now, I thought I would post my question here.
Many thanks,
Brett
With AVFoundation you can grab photos from the camera session...The way it works is you use one of the subclasses of AVCaptureOutput in order to get what you need, for still images you are going to want to use the AVCaptureSTillImageOutput subclass, here is a link AVCaptureStillImageOutput ref. Besides that you also have AVCaptureMovieFileOutput which is used to record a quicktime movie from the capture session to a file, AVCaptureVideoDataOutput which allows you to intercept uncompressed individual frames from the capture session, you also have audio outputs which you can use as well...hope this helps
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.