iPhone. Is it possible to load a video file and select a specific frame? - iphone

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.

Related

iPhone: get image from camera without UIImagePickerController

Please help me with my question.
Is there any way to get image from camera without UIImagePickerController?
I need to render current image(from camera) into image on my view and update it by timer.
May be AVCaptureStillImageOutput? I didn't find any examples.
Any ideas?
Yes, you can do it easily using AVCamCaptureManager and AVCamRecorder classes. Apple has a demo program build on its developer site here. It is named AVCam. In simple words what it does is when you click to open the camera, it calls the classes and methods which are responsible for opening the iPhone's camera and record video or capture audio. It calls the same classes which are called by UIImagePickerController.
I hope it helps.

Show subtitles in a MPMoviePlayerViewController by default

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+.

How to record a video automatically in Iphone app without user interaction

I am working an iphone app that needs to record a vedio automatically.
I used mobile coreservices framework and using that. I made it to came into video mode and clicking on record option its start capturing a vedio. But I want it automatically that is.. I should able to record a video without clicking on record option. That is when video mode comes up its automatically start record video.
Could any one help?
You can look at UIImagePickerControllers startVideoCapture method which is used to start taking video from the camera, this is to be used when you arent using the camera standard controlors and you provide and overlay view. Here is a reference UIImagePickerCOntroller ref. If this is not enough for you, you might want to look into AVFoundation framework which gives you a lot more control over video capturing process...hope that helps

How to keep MPMoviePlayerController open after movie ended?

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 :)

Hiding the Quick Time logo and controls when an audio file is played using MPMoviePlayerController

Hai all,
in my application i need to play a streaming audio, i used MPMoviePlayerController to play the audio, it works fine, but i don't want the Logo and controls appearing on the screen( like playing in the background).
is there any way to hide the logo and controls ?
thanks
There is no way to do this with the current Apple api. If you want to use undocumented api's, you can always access the private methods. Here is a good place to start looking:
Erica Sadun's Core Dumps 1
Erica Sadun's Core Dumps 2
Take a look at:
MPMusicPlayerController
or
AVAudioPlayer