Instance Property

volume

The audio playback volume for the player, ranging from 0.0 through 1.0 on a linear scale.

Declaration

var volume: Float { get set }

Discussion

A value of 0.0 indicates silence; a value of 1.0 (the default) indicates full audio volume for the player instance.

This property is used to control the player audio volume relative to the system volume. There is no programmatic way to control the system volume in iOS, but you can use the MediaPlayer framework’s MPVolumeView class to present a standard user interface for controlling system volume.

See Also

Managing Audio Output

var isMuted: Bool

Indicates whether the audio output of the player is muted.

var audioOutputDeviceUniqueID: String?

Specifies the unique ID of the Core Audio output device used to play audio.