Last active
July 13, 2021 18:00
-
-
Save Koze/058f12cd85d6f029c647 to your computer and use it in GitHub Desktop.
Private volume API with MPMusicPlayerController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MPMusicPlayerController has private method setVolume: and setVolumePrivate: | |
// The following KVO works on iOS 8.3. | |
MPMusicPlayerController *playerController = [MPMusicPlayerController systemMusicPlayer]; | |
[playerController setValue:@(0.1) forKey:@"volume"]; | |
[playerController setValue:@(0.2) forKey:@"volumePrivate"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cyberdude
I think that the volume of systemMusicPlayer is equivalent to device volume like Music app.
Therefore, there will be no API for control only the volume of the music.