Controls for AVPlayer - ios

I am using AVPlayer to display video in my iOS app. Now I need some nice looking controls for previous, next and the play/pause button. By default AVPlayer doesn't come with any.
I am wondering, are there any open source components out there that I can directly use for such controls? I actually just want the same controls that MPMoviePlayerController uses. But I guess that is not possible, unless I counterfeit them completely.
I could create them myself but I don't want to re-invent the wheel.

Here is a really nice one. BeamApp
https://github.com/BeamApp/MusicPlayerViewController

Related

How to hide only Next and Previous button in AVPlayer?

Is there any way to hide only Next and Previous buttons in AVPlayer while playing a video
You can only either hide them all or show them all via the AVPlayerViewController showsPlaybackControls property, so what I would recommend doing is using an open source or third party library or framework that controls AVPlayer for you.
Such as what's suggested by this related question, which ultimately points to this GitHub project. You can then remove or hide the controls you don't want to be visible.
Alternatively, you could create your own controls that call into, and control, AVPlayer.
=> you can get notification when ply or pause and stop
when you got notification of play at that time you can hide both next and preivios button

how to implement a audio player interface?

I'm using AVAudioPlayer to play mp3 files, but I need to implement ui interface as shown following:
I think it maybe a iOS system control I can use, but I can't find which control it is.
That is an MPMoviePlayerController. Compare, for example this illustration from my book:
The same section of my book tells you how to make and work with one of these. Despite the name, it's great for playing audio with a user interface. The only difference between our screen shots is that you had an AirPlay device present on the network at the time.

Adding Play Stop Pause icons to iPhone Media player app

I have built a player app. It has play, stop, pause rewind and ff buttons.
Where would I find 'stock' icons for the buttons? Eg. the same ones used on the YouTube app and apparently all the other 'mainstream' player applications.
Also, when I go from stop to play or pause, there's a white 'flash' that happens behind the button. Is this something I create programatically behind the buttons?
I may be making something difficult out of something easy. I just don't want to create 'custom' versions if there real ones are readily available in the package.
I noticed there's been quite a few views of this page, and wanted to update the limited success I had.
I discovered an excellent website called Glyphish.com which has an incredible selection of artwork.
Hope this helps.

Set Airplay manually?

I have an iPad app and I have a video playing in a view. I would like to play video using Airplay but by pressing my own button.
I have set allows airplay = YES and so forth, this works if I enable the full controls, but I want to set no controls and have my own button to play the video using Airplay.
So far, I have found no information that would allow me to play a video on AppleTV without allowing the normal controls.
So just using an UIButton action to force the airplay, or at least get available devices and set it manually. Anything that would allow me to do this.
MPVolumeView will only control audio, it won't control video. For that you'd need iOS 5's AVPlayer, or a movie controller.
An alternative for you might be to use AirplayKit, a 3rd party library.
https://github.com/rothacr/AirplayKit
To answer my own question.
This is quite possible without jailbreak.
Here is apple's own page explaining this, so this will pass the review process.
Apple developer library document explaining how to do this

How do I display video on external monitor while keeping controls on iPad?

My iPad app has the option to play videos. I use the MPMoviePlayerViewController class to play my videos.
My question is: if I want to play the videos on an attached external monitor, how do I keep the playback controls on the iPad like YouTube does? If I add the view of the MPMoviePlayerViewController 's player to the external screen's hierarchy I can play the video fine, but I now have no control over it. Is there a way to move or duplicate the view where the controls lie and place it on a view which resides on the iPad?
I'm not aware of an officially supported way of pulling out the original UI in this way. The MPMoviePlayerViewController only exposes the MPMoviePlayerController object it uses via its moviePlayer property. The MPMoviePlayerController in turn only exposes view and backgroundView, which aren't helpful for such a purpose. You could in theory inspect the subviews of the movie player's main view, find the playback controls and try to move them to the other screen. I have a feeling this will not end well though, as they're anything but static. You also never know what will happen in later iOS versions, or if they'll let your hack on the app store. It's probably less trouble to just re-do the UI yourself.
Actually controlling the video playback programmatically is straightforward - the view controller's moviePlayer implements the MPMediaPlayback protocol.

Resources