customising MPMovieplayer - iphone

In my new app,I have to show videos in MPMovieplayer.Client gave me the design as in screenshot
I want to know whether it is possible to customize like this(including the top like,skip buttons and the custom slider)
If it is possible,help me to learn more about that

You can do it pretty easily with AV Foundation specifically AVPlayer class, it is the framwork underneath MPMoviePlayer. It will give you the options to have an abstract video/audio player and you'll be able to create you own customize UI
Here's an example code to start with AVPlayer

AVPlayer will work, but I hear it can be more complicated than working with a more higer level solution like MPMoviePlayer. I've been working on making my own customized UI for a video stream using MPMoviePlayer.
Whenever you create your MPMoviePlayer object, just set control style to none with: MPMovieControlStyleNone this leaves your video player ready for you to make customize controls. I suggest using a UIToolbar and then setting UIBarButtonItems onto your toolbar. Once your toolbar has all your buttons, add the toolbar to the subview with the addSubview method. You can then add functionality to the buttons and slider with the MPMediaPlayback Protocol with methods like play and pause. By the way, the top like and skip buttons could just be UIButtons which are pretty customizable. Lastly, if you want the controls to disappear on a tap then look into Gesture Recognizers.
Of course you can style your buttons and position your toolbar as needed, but this should get you a basic start.

Here's a custom class I wrote that works in iOS6 and newer.
https://github.com/busterbooth/bbMoviePlayer
You can control and re-skin just about every aspect of the MPMoviePlayer as long as you do the following.
MPMoviePlayerController *mp= [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:#"http://example.com/video.file"]];
mp.controlStyle = MPMovieControlStyleNone;

Related

swift avplayer controller get fullscreen button

I'm pretty new in ios programming. Please, help me to find native solution to get the same button in avplayer controller as it is in safari:
How to enable this button in right bottom corner and assign my action to it?
I couldn't find, how to change AVPLayerController controls. But I made custom player with my control panels, using container view and embedding AVPlayerController.

iPhone camera toolbar buttons

The iPhone camera toolbar holds the following buttons: cancel/record
I would like to change the cancel button to the small image button that takes me to the photo library.
I wasn't sure if i need to use the overlay or does the xcode have something more comfortable in this case since this is something well known and used.
Is there something like this?
Thanks,
You can set overlayView to your UIImagePickerController
imagePicker.cameraOverlayView = yourOverlayView;
UIImagePickerController Class Reference
You can customize an image picker controller to manage user interactions yourself. To do this, provide an overlay view containing the controls you want to display, and use the methods described in “Capturing Still Images or Movies.” You can display your custom overlay view in addition to, or instead of, the default controls. Custom overlay views for the UIImagePickerController class are available in iOS 3.1 and later by way of the cameraOverlayView property. For a code example, see the PhotoPicker sample code project.

Embedded video in iPhone with smooth transition to MPMoviePlayerController

In the new American Idol app there are embedded videos that, if you tap them, start playing and showing "pause" and "augment" buttons. When you tap the augment button, you get an animation that smoothly launches the full screen MPMoviePlayerController. Do you know how did they make it?
I have implemented something like this by adding a gesture tap on that and implement the logic of the gesture. On a tap I have added a view with buttons like share (in my case). I am sorry I don't have that code anymore.

MPMoviePlayerController with a Custom Button on its toolbar

You might have seen video through you tube in iPhone.
Normal MPMoviePlayerController has previous, next & play/pause buttons.
You tube - player has additional two buttons on it.
=> Add to favorites on the left side.
=> Email this video on right side.
I want to implement the same for my application.
But I am failed to find out the property or methods regarding - implementing this.
How do I need buttons on it?
When User is watching video there should no buttons on screen.
When user taps on video - a toolbar comes on top & at center
A center tool bar has generally three buttons on it ,Previous - next -play/pause
I want to add a button beside next button & previous button.
I don't think you can modify the interface of an Apple provided view.
The general approach would be to play your video and then after it's done, show a view with the desired buttons/and or options for the user.
An example of this can be seen with the YouTube app on the iPhone. After the youtube video plays, the user is sent to a summary view with links to watch the video again, favourite it, share it, etc.
I would say that it may be possible to just set the MPMoviePlayerController's movieControlMode property to MPMovieControlModeHidden and add a subview to it with your own collection of buttons, titles, etc... But MPMoviePlayerController inherits only from NSObject, so you couldn't do that. Perhaps you can subclass MPMoviePlayerController and setup your own stuff when play is called, yet again, I imagine MPMoviePlayerController would display itself as a modal fullscreen view and hide anything you setup. :-\
If all you're looking to do is mess with the look of the controls, I DO know that you can mess around with various objects' drawRect: methods to override how bars and buttons are drawn.
For example, setting up a category or subclass of UINavigationBar and implementing drawRect: as follows will result in a custom navigation bar being drawn:
- ( void )drawRect:( CGRect )rect
{
[ [ UIImage imageNamed:kSTNavigationBarBackgroundImageName ] drawInRect:CGRectMake( 0.0, 0.0, self.frame.size.width, self.frame.size.height ) ];
}
This replaces Apple's standard look for their navigation bars and replaces it with a custom image asset. We do this, among other things, for our apps.

How Can I Implement Custom Previous/Next Buttons Over MPMovieplayer?

I have implemented a listing of videos in a UITableView. When I touch on a particular video then the video plays in an MPMovieplayer. Now, I want to make it so that if I touch on a next button, then the next video in the UITableView will play. How can I implement this?
Search for "MPMoviePlayer overlay" on stack overflow
Put an overlay over the movie with a previous and next button on it.
Make the buttons target methods that control MPMoviePlayer.