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
3
votes
1 answer

AVSystemController_SystemVolumeDidChangeNotification triggers when device locked

Using iOS 12, I am observing AVSystemController_SystemVolumeDidChangeNotification to detect volume presses to capture images: let volumeView = MPVolumeView(frame: CGRect(x: 0, y: -40, width: 0, height: 0)) // override volume…
shim
  • 9,289
  • 12
  • 69
  • 108
3
votes
0 answers

MPVolumeView route button not showing consistently in IOS 11 update

I created IOS app for live streaming with use of AVPlayer. I add the airplay routes button with help of MPVolumeView. After update of IOS 11, airplay routes button not coming up properly on screen. Sometime it show on screen sometimes not showing on…
3
votes
1 answer

Take picture with volume button

I'm developing an app with some camera functionality and I'd like to use the volume buttons to take a picture (as the Apple Camera app does). Using MPVolumeView and this snippet: let rect = CGRect(x: -500, y: -500, width: 0, height: 0) let…
Luca Torella
  • 7,974
  • 4
  • 38
  • 48
3
votes
6 answers

Can i using a custom slider to control volume?

As i know,MPVolumeView can add to my app for changing volume.But now i want to control volume with a custom slider. Maybe i can fit it myself if MPVolume was a subclass of uislider,indeed,it is a subclass of uiview. Ask for advices to realize my…
ben
  • 1,020
  • 1
  • 15
  • 27
3
votes
1 answer

MPVolumeView route list not rotating with background window.rootviewcontroller

I am facing one problem with mpvolume View. - it appears on screen as action sheet (i am sure it comes with uiwindow) once it appears and if i change my device rotation my actualwindow.rootviewcontroller (which present the mpvolume view) not…
Prabhat Kasera
  • 1,129
  • 11
  • 28
3
votes
3 answers

Hide volume HUD in iOS 8

In versions prior to iOS 8, there was a simple trick to hiding the system volume overlay. You'd simply create an MPVolumeView and embed it in your view hierarchy somewhere. This is documented here https://stackoverflow.com/a/7888977/3943258 and in…
Tim Johnsen
  • 1,471
  • 14
  • 33
3
votes
0 answers

Programmatically deselecting an MPVolumeView route

I'm working on an app that displays 10 second preview videos to airplay enabled devices via MPMoviePlayerViewController. The user selects an airplay enabled device through the system action sheet provided by MPVolumeView, and then we start the…
maxhs
  • 868
  • 2
  • 10
  • 14
3
votes
1 answer

iPhone how hide volume overlay when press volume key

I have do lots to solve it,like add MPVolumeView,someone says that system volume HUD will hide if you add a instance of MPVolumeView in current,but that not work i add obsever to observe the volume's change,and take picture but now i lost in how…
cskevincs
  • 31
  • 2
3
votes
0 answers

Is it possible enable AirPlay for specific AVAudioPlayer instances

I have an app with multiple AVAudioPlayer instances. One instance is for background music and the other instances are sound effects. I want the user the to have the ability to have the music routed over airplay but not the sound effects. I always…
techsMex
  • 594
  • 4
  • 16
3
votes
1 answer

MPVolumeView slider disappears when audio session changes

it´s my first question here so I apologize in advance if I commit any mistakes on the format of my question. I have a settings screen in my app where I placed a UISlider to control the volume, I got this slider from MPVolumeView like this: -…
3
votes
2 answers

How to keep the slider of MPVolumeView visible when connecting to Apple TV?

I'm using an MPVolumeView to control the volume of the AVPlayer in my app. When I connect use the Airplay-button next to the volume slider to connect to an AppleTV, the slider disappears. How can this be avoided? When I use the Music app to stream…
murze
  • 4,015
  • 8
  • 43
  • 70
3
votes
2 answers

Control Master Volume - iPhone, Cocoa Touch

I'm wanting to control the master volume of the iPhone with a UISlider. There is a way of doing it without code and I've forgot how to. So code or within the xib, how do I do this? Thanks
Plies Neyo
  • 237
  • 1
  • 4
  • 15
2
votes
1 answer

Preventing the volume HUD from appearing with MPMusicPlayerController, is it acceptable?

My issue is the HUD that accompanies a change in the MPMusicPlayerController's volume property. Whilst there is a solution, I want to know if it is acceptable by Apple to hide the MPVolumeView to prevent the HUD from showing? And on another note, if…
sooper
  • 5,991
  • 6
  • 40
  • 65
2
votes
2 answers

How to customize MPVolumeView in iOS?

I need to make a custom thumb for my volume slider, which I need it to be a MPVolumeView. Is there any way I can change it?
gabriel_vincent
  • 1,230
  • 3
  • 16
  • 35
2
votes
1 answer

MPVolumeView thumb image not correctly drawn horizontally

I´ve looked around but can´t find a solution... I have a MPVolumeView in my app to control the unit´s system volume. I changed the MPVolumeView SliderThumbImage to an image of my own and what I´ve noticed is 2 bugs: Bug 1 : The thumb image…