Is there a way to get the frame (i.e. size and location) of the media loaded in an MPMoviePlayerController? I understand the naturalSize property, but I also would like to know the location of the media so I can overlay a UIView above the media that doesn't cover the playback controls or the unused space around the media.
Alternatively, is there a way to retrieve the size of the playback controls? I would settle for a UIView that covers all of the player except for the controls.
Looking at the header source of MPMoviePlayerController I found:
// The view in which the media and playback controls are displayed.
#property(nonatomic, readonly) UIView *view;
Related
I have been messing around with the AVFoundation framework for iPhone, but I can't seem to be able to get the information from the back video camera to display on an UIImageView I have in interface builder.
This is a single view application.
I just want to get what the back camera sees displayed on an UIImageView.
Thank you!
You don't need a UIImageView, just a UIView.
Take a look at AVCaptureSession and AVCaptureDeviceInput in AVFoundation. With these you can access the cameras.
AVCaptureVideoPreviewLayer can be used to draw the camera input to a UIView.
http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureVideoPreviewLayer_Class/Reference/Reference.html
Hopefully this answers your question: http://www.ios-developer.net/iphone-ipad-programmer/development/camera/camera-preview-on-a-view-controller
Please let me know if you would like any more information!
Is it possible to play the video in uiview's subview (popup) on the same screen only not by using the iPhone video player which player the video in full screen mode.
Any help would be appreciated.
Thanks,
Insert a HTML5 video tag into UIWebView, then subview it into UIView. I can guarantee that it works for Youtube videos.
I have a table view that contains an instance of MPMoviePlayerController as the table header and when the user presses my custom overlay button, the video expands to full screen. The aspect ratio of the video is such that in portrait mode it is very small, and I imagine most users will rotate to landscape.
The problem is that I want to allow rotation when the video is full screen but not when it exits. My underlying table does not support landscape. Is there a way to support rotation only when full screen? I thought this would be a standard component of MPMoviePlayerController.
I'm using SDK 5.0, but it was originally built with 4.3.
Have you tried subclassing the MPMoviePlayerController MPMoviePlayerViewController class, and overriding the method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (!self.fullscreen) {
return UIDeviceOrientationIsPortrait(interfaceOrientation);
}
return YES;
}
In my application i want to set the title for the video (At the time of video playing). How do I do this?
You can try placing a UILabel over the movie player's view
i have the video controlls set to hidden in my app with the code
[mp setMovieControlMode:MPMovieControlModeHidden];
this sets in hidden for the whole video.
what i want to do is have the controls hidden at the start but if the screen is pressed then have the controls display any suggestions? would be much appreciated.
There is a good answer here:
How to hide control before MPMoviePlayerController movie is played?