Instance Method

audioPlayerBeginInterruption(_:)

Called when an audio player is interrupted, such as by an incoming phone call.

Declaration

optional func audioPlayerBeginInterruption(_ player: AVAudioPlayer)

Parameters

player

The audio player that has been interrupted.

Discussion

Upon interruption, your application’s audio session is deactivated and the audio player pauses. You cannot use the audio player again until you receive a notification that the interruption has ended.

See Also

Handling Audio Interruptions

func audioPlayerEndInterruption(AVAudioPlayer, withOptions: Int)

Called after your audio session interruption ends, with options indicating the state of the audio session.

Deprecated
func audioPlayerEndInterruption(AVAudioPlayer)

Called after your audio session interruption ends.

Deprecated
func audioPlayerEndInterruption(AVAudioPlayer, withFlags: Int)

Called after your audio session interruption ends, with flags indicating the state of the audio session.

Deprecated