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
didStartPlayingTrack
will be called at once.Declaration
Swift
@objc(lwayveSDKDidStartLoadingTrack:) optional func lwayveSDK(didStartLoadingTrack track: AudioTrack)
Parameters
track
The 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
track
The 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
track
The 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
track
The 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
track
The 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
track
The 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
track
The audio track that failed to play.
error
The error object.
-
This method is called when the audio player status has changed.
Declaration
Swift
@objc(lwayveSDKPlayerIsReadyToPlayStatusDidChange:) optional func lwayveSDK(playerIsReadyToPlayStatusDidChange isReadyToPlay: Bool)
Parameters
isReadyToPlay
Set to
true
when 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
canSkip
Set to
true
when 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
canRewind
Set to
true
when the rewind action can be performed. A host application should disable the Rewind button whencanRewind == false
.