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
25
votes
12 answers

iOS 9: How to change volume programmatically without showing system sound bar popup?

I have to change the volume on iPad and using this code: [[MPMusicPlayerController applicationMusicPlayer] setVolume:0]; But this changing volume and showing system volume bar on iPad. How to change the sound without showing the volume bar? I know,…
mgv
  • 347
  • 1
  • 3
  • 9
17
votes
14 answers

Hide device Volume HUD view while adjusitng volume with MPVolumeView slider

I was implementing a video player with MPMoviePlayer in my iPad Application, used MPVolumeView for the volume control. My problem is that when i scroll the volume view to adjust the volume is showing the device's volume hud overlay as in the…
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
17
votes
4 answers

How to do screen mirroring using AirPlay from the application (not from control centre) in iOS?

I am using MPVolumeView to show AirPlay button. I need to show a custom wallpaper to Apple TV through mirroring with audio. Audio is playing properly on Apple TV but wallpaper image is not showing. I am using AVAudioController for playing audio. I…
Mukesh2421
  • 191
  • 1
  • 6
15
votes
2 answers

New OutputDeviceUID is nil msg when instantiating MPVolumeView

Today, likely as a result of upgrading to iOS 12.3 on my test phone, I am now receiving the following notifications in my debug console when I first instantiate my MPVolumeView. 019-05-21 11:00:22.874353-0600 sports-audio-dj[3831:982163] …
HOTGS James
  • 321
  • 2
  • 9
14
votes
4 answers

AirPlay support, MPMoviePlayerController and MPVolumeView relation

I am developing an iPhone application that has support for video play. I am using MPMoviePlayerController with custom controls for playing the video. For this purpose I have set control style of MPMoviePlayerController to MPMovieControlStyleNone. I…
spd
  • 2,114
  • 1
  • 29
  • 54
13
votes
4 answers

Hide grey volume overlay when using MPVolumeView?

I've put a MPVolumeView over a movie I'm playing. The trouble is, whenever I adjust the vol using the MPVolumeView, then the standard grey volume overlay appears (the one that appears when you use the rocker switch on the iPhone). Is there a way to…
cannyboy
  • 24,180
  • 40
  • 146
  • 252
13
votes
1 answer

Swift: how to set the iphone volume programmatically

I am trying to create an alarm app and I have noticed that apps like Sleep Cycle will set your volume to max right before the alarm goes off, even if you had the volume at very low. I have tried using AVAudioPlayer and all I have seen with…
Charles
  • 393
  • 1
  • 3
  • 15
12
votes
4 answers

How to change volume programmatically on iOS 11.4

Before, I was setting sound volume programmatically using this approach: MPVolumeView *volumeView = [[MPVolumeView alloc] init]; UISlider *volumeViewSlider = nil; for (UIView *view in [volumeView subviews]) { if ([view.class.description…
iOS Dev
  • 4,143
  • 5
  • 30
  • 58
12
votes
1 answer

How to change tvOS system volume

On iOS we can use MPVolumeView to change the system volume but it's not available on tvOS. Is there any API that allows us to change tvOS' system volume?
Lars Blumberg
  • 19,326
  • 11
  • 90
  • 127
11
votes
3 answers

How do you implement an MPVolumeView?

I want the user to be able to change the system volume with a slider, and I realized the only way to do this is with an MPVolumeView. But I can't find any example code for it, and every method I try to implement won't show up. So what is the easiest…
Emil
  • 7,220
  • 17
  • 76
  • 135
10
votes
3 answers

showsRouteButton from MPVolumeView is deprecated

Since iOS 13, showsRouteButton from MPVolumeView has been deprecated let vv = MPVolumeView() vv.showsRouteButton = false Warning is : 'showsRouteButton' was deprecated in iOS 13.0: Use AVRoutePickerView instead. Apple is telling me to use…
batsansierra
  • 315
  • 1
  • 12
9
votes
1 answer

MPVolumeView no longer works on iOS 7 devices

So far I've been using an MPVolumeView to control the volume of my iOS devices, which worked just fine until updating to iOS7. I've created a test project (Base SDK 6.1, Deployment Target 5.1) which has only one MPVolumeView on a single UIView.…
Toubey
  • 199
  • 3
  • 14
8
votes
2 answers

MPVolumeView AirPlay Button Not Visible

I have started using MPVolumeView in my app, however the Air Play button doesn't appear at all. Even though I have more than one Air Play device available to send my AVPlayer audio to on the network. These can be seen if checking Air Play from the…
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
8
votes
2 answers

MPVolumeView animation on iOS 8

In iOS 8 there is a problem or a feature. When MPVolumeView is shown, it's being animated, like expanding from 0 to it's width. How can I fix that behavior? There was no such problem on iOS 7.
8
votes
4 answers

MPVolumeView doesn't redraw correctly in iOS 7

So I have an iOS7 app that I'm using a MPVolumeView in so the user can control the volume level. I have the route button hidden on this particular MPVolumeView and use another MPVolumeView with the slider disabled as my AirPlay icon. My app…
jrwagz
  • 586
  • 6
  • 15
1
2 3
9 10