I am using MPVolumeView to add the airplay button in my app,
I am using the following code.
myVolumeView =
[[MPVolumeView alloc]initWithFrame:CGRectMake(self.view.frame.size.width-130, 25,20,20 )];
[myVolumeView setShowsVolumeSlider:NO];
[myVolumeView setShowsRouteButton:YES];
[self.view addSubview:myVolumeView];
I am able to see the route button, but when I click on it, it showing "iPhone" as only one item in device list.
But when I swipe up in iOS 7, and click on Airplay option then I can see multiple routing devices using airplay,
I am stuck here, why this happening? Logically if the app unable to detect the airplay device the route button should not visible, but it is visible then why it not showing any device, but system default airplay detect and listed the airplay device.
Thanks in advance for your suggestions.
Are you using AVAudioSessionCategoryPlayAndRecord session category? Replace AVAudioSessionCategoryPlayAndRecord with AVAudioSessionCategoryPlayback category and ArPlay picker will allow you to change output source.
AirPlay device can't record, that's why it's not showing in your AirPlay picker.
Related
Background:
I have a live iPad app. in the apple store. I am now developing the iPhone version.
I used MPMoviePlayerController in the Ipad version. But, I had to use the MPMoviePlayer*View*Controller for the Iphone version to solve some orientation problem.
Problem:
In the iPad version when the user go to the fullscreen he will have the Done and the Exit Fullscreen Buttons.
In the iPhone version the Exit Fullscreen Button does not appear. Only the Done button is appearing.
Note 1:
Using the MPMoviePlayerController and not the ViewController won't solve the problem for the iPhone.
Note 2:
The done button will pause the movie while the exit button will keep the movie playing in the other view I have.
Any ideas, please help.
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
I have written an app for iPhones and for the 4S I want to support screen mirroring of the application over AirPlay.
Using the System AirPlay picker the and with Mirroring turned on it will mirror the app without any issues.
I would like to offer this picker in the app and have used the following basic code:
MPVolumeView *volumeView = [ [MPVolumeView alloc] init] ;
[volumeView setShowsVolumeSlider:NO];
[volumeView sizeToFit];
[self.view addSubview:volumeView];
This provides an AirPlay picker and I can select the Apple TV. However it does not mirror the content over AirPlay. When I go to the system picker it shows that the AppleTV is selected, and to enable mirroring I have to use the switch here.
So the question is, how can I turn on mirroring in the app when a user selects AirPlay using the app picker?
Thanks
The only way to programmatically enable mirroring is to use private APIs. See here
I am pretty sure mirroring can only be enabled from the system supplied menu in the multitasking bar.
In my app it has lots of videos and animation to present a view. Am implemented External display by using TVOutManager sample app. Every thing works fine except video part.
inside my application videos are playing fine but in external window it not showing anything is simply shows "TV is connected, Video is playing in TV" in a small window.
So how to resolve this.. how to display inside app video to external window.
any idea or am i doing something wrong here..
thanks,
Here am answering to my own question.
robterrell's TVOutManager will not play any video to external device by simply doing [[TvOutManager sharedinstance] startTvOut] and [[TvOutManager sharedinstance]s topTVOut];
here we have add the instance of player to tvoutWindow.
[tvoutWindow addSubview:player's instance];
but here thing is the video is not displayed in device,
but you can control external window player from device.
cheers.
I would like to allow controlling the iPod on top of my application when the user double taps the home button. I know there are a few apps out there that allow this. Unfortunately my app just quits.
Do I have to set anything to allow this behavior?
Is it possible that my app prevents the iPod app from showing above it because it also plays a sound from time to time?
The double-tap-for-iPod behaviour, if people are using the defaults (most people do) only works to bring up the mini player if music is already playing.
Check out Settings > General > Home. As you can see, there are a variety of things the user can choose to happen on double-click. Below that list of things, there is the option for "iPod controls" - when playing music, show iPod controls. This is what you want, and unfortunately there is no way you can choose to override the default behaviour and show iPod controls when music isn't playing.
There are 2 other options (both for the user, not you unfortunately):
If they turn the screen off, whilst in your app, and then double-click the home button, the mini player will show on screen and then they can play music. They will then still be within your app when they turn on and unlock the screen.
If they have a 3G-S or latest iPod Touch, then holding the home button will bring up the voice command menu, from which they can play music. They will then still be in your app when that menu closes.
Probably not the answer you wanted, but that's iPhone development for you!