I have this MPMovePlayerController and a custom slider (which is not exactly a slider, but has the same purpose). Given that my βsliderβ can return any float value that I need, how can I change the volume of the movie being played?
While I was trying to hack MPVolumeView, to programmatically set the value without success.
Turns out that
[[MPMusicPlayerController applicationMusicPlayer] setVolume:<insert float here>];
works for any sound in the application, even MPMoviePlayerController if it uses the main audio session. Oh, this only works on the device, not on the simulator. More information here: https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller?language=objc
Volume is not recommended in iOS 7.0.
"To provide a user interface for adjusting system playback volume, use the MPVolumeView class, which provides the media playback controls that iOS users expect and can customize." Deprecated MPMusicPlayerController Volume Method
MPVolumeView
It will change the volume of the device, not the media player, so that any other audio or video streams also affect.
Source: https://habr.com/ru/post/885680/More articles:Pattern for discontinuous cycles using actors - scalaDifferences from fonts from 4.1 to 4.5 - flexMercurial / Kiln, how can I get a deleted file without affecting my other files? - version-controlHow to get a bitmap from a raw image - androidGood books / articles on spatial pointers - algorithmNHibernate, SQL Server - mapping an enum to int - sql-server-2005How to calculate FPS in OpenGL? - cDetect if IE7 or lower with conditional comments and javascript not working - javascriptWhat is the correct way to calculate FPS if the GPU has a task queue and is asynchronous? - profilingAny good external analytics analytics tool? - hadoopAll Articles