AudioControlDelegate
@objc(LwayveAudioControlDelegate)
public protocol AudioControlDelegate : AnyObject
The methods of the protocol allow the delegate to handle the sequence of audio track calling.
-
This method is called when the audio track has started loading before actual playing. This method may be not called if the track was preloaded before. In this case method
didStartPlayingTrackwill be called at once.Declaration
Swift
@objc(lwayveSDKDidStartLoadingTrack:) optional func lwayveSDK(didStartLoadingTrack track: AudioTrack)Parameters
trackThe audio track that started playing.
-
This method is called when the audio track has started playing.
Declaration
Swift
@objc(lwayveSDKDidStartPlayingTrack:) optional func lwayveSDK(didStartPlayingTrack track: AudioTrack)Parameters
trackThe audio track that started playing.
-
This method is called when the audio track was paused.
Declaration
Swift
@objc(lwayveSDKDidPauseTrack:) optional func lwayveSDK(didPauseTrack track: AudioTrack)Parameters
trackThe audio track that was paused.
-
This method is called when the audio track was almost played to the end (about 0.1 sec left to the end).
Declaration
Swift
@objc(lwayveSDKDidAlmostPlayTrackToEnd:) optional func lwayveSDK(didAlmostPlayTrackToEnd track: AudioTrack)Parameters
trackThe audio track that was paused.
-
This method is called when the audio track was played to the end.
Declaration
Swift
@objc(lwayveSDKDidPlayTrackToEnd:) optional func lwayveSDK(didPlayTrackToEnd track: AudioTrack)Parameters
trackThe audio track that was paused.
-
This method is called when the audio track has ended.
Declaration
Swift
@objc(lwayveSDKDidEndPlayingTrack:) optional func lwayveSDK(didEndPlayingTrack track: AudioTrack)Parameters
trackThe audio track that ended.
-
This method is called when the SDK has reached an error.
Declaration
Swift
@objc(lwayveSDKDidFailPlayingTrack:withError:) optional func lwayveSDK(didFailPlayingTrack track: AudioTrack, withError error: Error)Parameters
trackThe audio track that failed to play.
errorThe error object.
-
This method is called when the audio player status has changed.
Declaration
Swift
@objc(lwayveSDKPlayerIsReadyToPlayStatusDidChange:) optional func lwayveSDK(playerIsReadyToPlayStatusDidChange isReadyToPlay: Bool)Parameters
isReadyToPlaySet to
truewhen the audio player has tracks to play. A host application should disable play controls whenisReadyToPlay == false. -
This method is called when the audio player status has changed.
Declaration
Swift
@objc(lwayveSDKPlayerCanSkipStatusDidChange:) optional func lwayveSDK(playerCanSkipStatusDidChange canSkip: Bool)Parameters
canSkipSet to
truewhen there is at least one unfinished track. A host application should disable the Skip button whencanSkip == false. -
This method is called when the audio player status has changed.
Declaration
Swift
@objc(lwayveSDKPlayerCanRewindStatusDidChange:) optional func lwayveSDK(playerCanRewindStatusDidChange canRewind: Bool)Parameters
canRewindSet to
truewhen the rewind action can be performed. A host application should disable the Rewind button whencanRewind == false.
View on GitHub
AudioControlDelegate Protocol Reference