We have an iOS APP project which will play video in our custom window and would like to play the downloaded video files. According to such kind of demand, is that possible to do that?
This is possible. Please check the documents for MPMoviePlayerController . This allows you to play a video and managing your own view hierarchy/custom views. To play a video inline, you need to use the view property of your MPMoviePlayerController instance an put it into your view hierarchy. The features of MPMoviePlayerController have changed with iOS 3.2, so while using it, be sure to only use features for your deployment target.
Related
I am new to iOS app developing field. I am trying to capture video using AVFoundation. I am successful in this. But when I tried to play the video back using MPMoviePlayerController, I got too many issues. So I am trying to play using AVPlayer.
But in AVPlayer there are two approaches AVPlayerLayer and AVPlayerViewController.
I tried searching about those, but I didn't get any particular reason to choose one.
Can anyone suggest me which is better to use?
AVPlayerViewController is an all in one solution. You setup your AVPlayer with a video and present the player controller. It handles all the playing and has its own controls baked in (I'm sure you've used seen this in other apps). It is the simplest way to show a video.
AVPlayerLayer is for when you want to add some customization, like adding your own controls or extra views, or not making the video full screen.
I'm new to Swift and I don't know Objective C. I am looking forward to design a standard audio player. I've noticed that music, podcast, and telegram apps use kind of the same player. I don't know how to add that player in my app. Did they design it from scratch or is there a ready made player bar that can be added in my app?
I've downloaded the source of telegram app, but it is big, in objective C, and doesn't compile!
So, how to get that player?
Try out LNPopupController, is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.
It has Demo Music Scene in both Objective-C & Swift
Note: this is the UI/UX of the player not the actual player so it doesn't inluclude any AVAudioPlayer. To build your player you could have a look to this: Playing a sound with AVAudioPlayer
LNPopupController is just great, but if you want to keep your own controls on the toolbar, create your own. For reference:here
I am new to iOS, and am using PageViewController to set up an app with books. I am having a hard time finding any information on setting up sound with each page. How do you add mp3 files into an array using AVFoundation?
You can play a audio file in background usinf AVAudioPlayer u can even play different audio for different page.... Change audio file inside page view controller delegate method, visit this link for more detail info
I am working on an app that can play some short animated clips. At this point my only option is to embed animated frames. It works just fine. But I am just wondering if there's another way to simply embed the animated files directly as a movie clip in order to avoid importing tons of frames. Perhaps it'd be better for image compression.
In that regards I am aware of these alternatives: the MediaPlayer Framework, MPMoviePlayerController presented here http://mobile.tutsplus.com/tutorials/iphone/mediaplayer-framework_mpmovieplayercontroller_ios4/ and also some other techniques showed here http://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios
However this would mean using Apple's UI. I would like instead to create a more integrated experience that is using my own app UI.
Is there a library for that?
Take Look at AVPlayer Class Reference
https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html.
and AVPlayerLayer Class Reference
http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayerLayer_Class/Reference/Reference.html
It has the ability to do what you need. You can aslo animate the layer just like other CALayers
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.