INNER CODE UNIT · Swift
onStart
rxlabz/audioplayer · audioplayer/ios/Classes/SwiftAudioplayerPlugin.swift:119
func onStart() {
let duration: CMTime = player!.currentItem!.duration
if CMTimeGetSeconds(duration) > 0 {
let mseconds: Int = Int(CMTimeGetSeconds(duration) * 1000)
_channel.invokeMethod("audio.onStart", arguments: mseconds)
}
}
func onSoundComplete(note _: Notification) {
stop()
_channel.invokeMethod("audio.onComplete", arguments: nil)
}
func onTimeInterval(_ time: CMTime) {
let mseconds = time.seconds * 1000
_channel.invokeMethod("audio.onCurrentPosition", arguments: Int(mseconds))
}