UIAudioPickerController for iPhone App? - iphone

Not sure what to call this, but I'd like to offer a way for users to pick and control their music from within my app. I've seen a few apps that offer an "iPod" button that appears to bring up the iPod app. Is this a built in control like the UIImagePickerController or have they simply duplicated all the functionality?

Check out the MediaPlayer framework. In particular, you're talking about the MPMediaPickerController

What I'm doing in Couch to 5k is inserting a UIView with a toolbar, labels, and an image view. The toolbar has the standard buttons for controlling the iPod music player. Then I'm using MPMusicPlayerController to control the iPod music playback.
Here's some sample code to get the iPod music player and what's playing:
musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
item = musicPlayer.nowPlayingItem;
And then I register for NSNotification using the code provided in Apple's documentation on MPMusicPlayerController.

Related

How to show playing item details in the iphone/ipad dock bar?

I make use of a AVPlayer to reproduce music tracks in the iPod Library.
I got the background management done, and now I can see my app icon showing in the dock bar when tapping twice the home button.
Media buttons also work fine with my app.
What I would like to do now is to show now playing item info in the same dock bar, as iPodMusicPlayer does.
Is it possible?
Use the MediaPlayer framework:
#include <MediaPlayer/MediaPlayer.h>
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:#{
MPMediaItemPropertyAlbumArtist:#"Album Artist",
MPMediaItemPropertyAlbumTitle:#"Album Title",
MPMediaItemPropertyTitle:#"Title",
MPMediaItemPropertyArtist:#"Artist"
}];
You cannot do that using iOS public API's. As far as iPod Music App is considered, it is a native iOS application built in by Apple and it uses Private API's for sure.
This is apple's sample code, may be this will help
http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html

iPad - Custom Movie Player Like GQ Magazine App

I'm developing an iPad magazine App.
While researching other apps I thought the GQ one was the best.
I would like to implement a similar custom movie player in my app. It would include a Play button, pause button, stop button, and slidebar along with the player.
I'm looking for ideas on how GQ implements a player like this or how I may go about creating my own.
MPMoviePlayerController
UIButton
UISlider

Which options exist since iOS 4.0 to embed video in a view?

I'm shipping a quicktime .mov video encoded with H.264, low quality. It's about 2 MB small. Not full-screen.
The video must be embedded in a view. Is MPMoviePlayerController state-of-the-art for this purpose, or are there better (easier) options?
It's important that the video plays in the non-fullscreen view, and that playback controls are either overlayd on top of the video or can be customized. I'm not sure if MPMoviePlayerController is good for this.
MPMoviePlayerController and MPMoviePlayerViewController are two classes you can use to play video in iOS SDK.
MPMoviePlayerViewController is supposed to be presented as a modal view controller, so it's not what you're looking for.
MPMoviePlayerController plays the video onto a view (UIView) which you can add in your view hierarchy, which is what you need.
Be aware that on iOS < 3.2, MPMoviePlayerController is fullscreen only (not a problem if you're targeting 3.2 or newer).
Although you can do customizations by adding your own buttons (for play, pause and stop controls), sliders (for volume and seeking) and labels (to display duration and length), Apple encourages the use of standard video controls. The reason is that users are used to the standard UI (which is also pretty advanced, supporting features such as fine scrubbing), plus if Apple ever adds new features to it in future versions of iOS, you won't have to add them yourself in your customized implementation.
MPMoviePlayerController is the most straight forward way to play a video, you can do other things including
Play it on a web view
Use AVFoundation and AVPlayer to play the video
With MPMoviePlayerController the video isnt "embedded" in the view rather another view pops up and plays the video, with AVFoundation and AVPlayer you can actually embed it into your view...check out this stack over flow question which details how to use the AVFoundation to play a video here

Getting a UIView Animation to play through airplay

I'm using UIView animation blocks to crate a slidshow of images. I'd like to allow users to play those animations through AirPlay. Would I somehow have to save a video file and play that or is there something more clever that could be done?
In iOS 5, user will be able to mirror the screen using AirPlay to there other AirPlay devices (mainly the Apple TV).
In the current stable version of iOS (4.3.5 as of this writing), I don't think that can be made (except, like you said, with a video file).

Playing video in a Customview like iPad feature

When we call MPMoviePlayerController.play method, the movie player is opened and the video is played in a separate full screen. is it possible to play a video in a custom view, that is I have an image added on a view, when this image is clicked, the image has to be removed and the video has to play there itself as the feature in iPad.
Non-full screen playback of video is possible in iPhone OS 3.2 for iPad.
If you are porting an application that uses the MPMoviePlayerController class of the Media Player framework, you must change your code if you want it to run in iPhone OS 3.2. The old version of this class supports only full-screen playback using a simplified interface. The new version supports both full- and partial-screen playback and offers you more control over various aspects of the playback.
On the full-screen question, see this section of the iPad Programming Guide for further information, and this property of MPMoviePlayerController specifically.
Bear in mind that you can still only play one video at a time, and that this is only currently possible for iPad.
Not using MPMoviePlayerController, no.
You might be able to achieve this using a custom movie player, but I haven't seen one in the wild yet, and I don't know how it would be done.