5

I have the following code, but it doesn't display the route button.

MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:CGRectZero];
volumeView.showsRouteButton = YES;
volumeView.showsVolumeSlider = NO;
[volumeView sizeToFit];
[self.view addSubview:volumeView];
[volumeView release];

In the documentation I read:

The route button is visible by default when there is more than one audio output route available.

I only have one audio output, so the button doesn't show. Is there any way to simulate multiple audio outputs so that I can test this button?

Erik B
  • 40,889
  • 25
  • 119
  • 135

2 Answers2

1

You can use AirPlayer (a Mac Application) to simulate an Apple TV. This should cause the AirPlay button to appear in the simulator. Although it claims to not work with audio, the AirPlay button may still show up.

Jonathan.
  • 53,997
  • 54
  • 186
  • 290
  • 1
    I've already tried that. It didn't work. It has to support audio. – Erik B Mar 28 '11 at 21:29
  • You can try the [windows version](http://www.tuaw.com/2010/12/22/airmedia-player-for-windows-stream-from-ios-to-your-windows-pc/) else you'll probably have to use an Apple TV then (buy one from Apple shop, test, return & refund) – Jonathan. Mar 28 '11 at 21:45
  • I could, if I had windows. I use Linux on all my old PCs and Mac OS X on all my Macs. – Erik B Mar 29 '11 at 06:33
  • @Eric you might be able to try WINE. If you have a jailbroken iOS device there's AirView on cydia. Which is like AirPlayer, but I'm not sure if it does audio. – Jonathan. Mar 29 '11 at 06:50
0

Since some time has past and I still haven't gotten any correct answers, I thought I would share how to solve this problem without buying an Apple TV or other air play device.

The way I solved it was simply to use a bluetooth headset, which costs much less than an Apple TV.

Another suggested way to solve it is to use AirView on another iOS device. I haven't tested this, but judging from the comments it doesn't support sound, so I don't think it works.

I intend to accept this as my answer, but I will change my accept if anyone finds a real way to simulate multiple audio outputs.

Erik B
  • 40,889
  • 25
  • 119
  • 135