Questions tagged [mpvolumeview]

MPVolumeView is a class from MediaPlayer framework in iOS. Used to present the user with a slider control for setting the system audio output volume, and a button for choosing the audio output route.

When first displayed, the slider’s position reflects the current system audio output volume. As the user drags the slider, the changes update the volume. If the user presses the device volume buttons while sound is playing, the slider moves to reflect the new volume.

If there is an Apple TV or other AirPlay-enabled device in range, the route button allows the user to choose it. If there is only one audio output route available, the route button is not displayed.

When an audio output route that does not support volume control, such as A2DP, is active, the volume slider is replaced with the route name.

145 questions
8
votes
3 answers

Change Color of MPVolumeView Route Button iOS 7

I am designing a Music app for iOS 7 and I want to put the "AirPlay" route selector button directly in my app. I am able to get the button placed just fine, however it doesn't show up because the icon is white and my background is white. Is there a…
jrwagz
  • 586
  • 6
  • 15
8
votes
2 answers

AirPlay menu incorrectly displays in portrait on iOS 6

I'm using an AVPlayer and MKVolumeView to display the native AirPlay output menu. In iOS 6, the AirPlay output menu seem to be presented in portrait regardless of the orientation of the status bar. In iOS 5, it followed the status bar…
Anton
  • 5,932
  • 5
  • 36
  • 51
7
votes
1 answer

Dismiss iOS native MPVolumeView audio route menu

I'm using MPVolumeView to allow the user to control his preferred audio route when using my application. The view is presented by this code: self.volumeView = [[MPVolumeView alloc] initWithFrame:self.view.frame]; self.volumeView.showsVolumeSlider =…
Simon
  • 71
  • 1
7
votes
2 answers

Custom MPVolumeView Thumb Image not vertically centered since iOS 5.1

I'm building an application that needs an MPVolumeView to control the volume. It worked perfectly before iOS 5.1 but since the 5.1 update the thumb image is no longer vertically centered. I tried a few things like changing imagine dimensions,…
Hulk_SMASH
  • 553
  • 1
  • 7
  • 13
6
votes
1 answer

How to change metadata for AVRoutePickerView?

My app plays some sound and I implemented AVRoutePickerView so it can stream its sound through AirPlay or Bluetooth. Once I tap the AVRoutePickerView, above image pops up which is good, however, with wrong image and title. The image and title came…
6
votes
3 answers

MPVolumeView change size of Airplay icon

I have an MPVolumeView on one of my views, which comes up with an Airplay icon when there are other output sources available. That's all fine, but the icon is tiny, no matter how big I set the frame for MPVolumeView it doesn't get any bigger. Anyone…
rustyshelf
  • 44,963
  • 37
  • 98
  • 104
6
votes
3 answers

Initialising MPVolumeView causes app crash on iOS 11 beta 3

Since 3rd beta of iOS 11 my app has started crashing when initialising a MPVolumeView used for AirPlay. The following piece of code is working perfectly fine on earlier versions of iOS and iOS 11 beta 1 and 2. func setupAirplayButton() { let…
anders
  • 457
  • 2
  • 19
6
votes
3 answers

how to set the maximum and minimum image of MPVolumeView correctly

i am trying to set the maximum and minimum image of MPVolumeView but i can't get it working here is the code VolumeView.setVolumeThumbImage(UIImage(named: "VolumeSlider"), forState:…
Amr Mohamed
  • 2,290
  • 4
  • 20
  • 39
6
votes
2 answers

MPVolumeView animation issue

Every time I add MPVolumeView as a subview to my UIViewController’s view, there is a quick animation (the MPVolumeView expands from left to right) which looks really weird. I’m looking for a way to get rid of this animation, has anyone faced this…
dariaa
  • 6,285
  • 4
  • 42
  • 58
6
votes
3 answers

How can I set the tint color of a MPVolumeView?

How can I set the tint color of a MPVolumeView? I see the method: setMinimumTrackTintColor: and the property minimumTrackTintColor however using either of those throws an exception. I was told I need to call setMinimumTintColor or set the…
Phillip
  • 1,205
  • 3
  • 15
  • 22
6
votes
4 answers

Matching MPVolumeView and UISlider vertical positions in a UIToolBar

I have a UIToolBar that is intended to contain sliders for controlling volume and brightness. I use a MPVolumeView slider for the volume, and an ordinary UISlider for the brightness. While the sliders themselves work fine, their vertical positions…
Kaj_Sotala
  • 213
  • 3
  • 9
5
votes
3 answers

MPVolumeSlider's MPVolumeControllerSystemDataSource not available in iOS 11.4

Today, I upgraded iOS to its latest 11.4. To set system volume, I am using the below method. -(void) setVolumeLevel:(float)val { MPVolumeView *slide = [MPVolumeView new]; UISlider *volumeViewSlider; for (UIView *view in [slide…
aios
  • 405
  • 5
  • 14
5
votes
0 answers

MPVolumeView Airplay Button Disappears

I have created a custom video player in Swift using AVPlayer and am using the MPVolumeView for the volume control as well as AirPlay. The views initialize perfectly, but I am running into a case where the AirPlay button disappears inside the…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
5
votes
1 answer

MPVolumeView route list is supporting all orientations and ignoring underlying view controller

This appears to be an OS bug, but a workaround is still needed. Targeting iOS 8 or 9, using view controller based orientation, MPVolumeView's route list will always rotate, even if its parent view controller only supports a single orientation. This…
Ric Santos
  • 15,419
  • 6
  • 50
  • 75
5
votes
1 answer

How can i set MPVolumeView with swift?

i want to set Iphone Speaker default. My volume control swift code is below. It is works fine but when i tapped airplay button i see automatically select the second.(Iphone) var wrapperView = UIView(frame:…
davudi
  • 117
  • 3
  • 13
1
2
3
9 10