INNER CODE UNIT · Swift

mute

rxlabz/audioplayer · audioplayer/ios/Classes/SwiftAudioplayerPlugin.swift:152

    func mute(muted: Bool) {
        player?.isMuted = muted
    }

    func seek(time: CMTime) {
        playerItem?.seek(to: time)
    }

    open override func observeValue(
        forKeyPath keyPath: String?, of object: Any?,
        change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?
    ) {
        if keyPath == #keyPath(player.currentItem.status) {
            if player!.currentItem!.status == AVPlayerItem.Status.readyToPlay {
                onStart()
            } else if player!.currentItem!.status == AVPlayerItem.Status.failed {
                _channel.invokeMethod("audio.onError", arguments: [player!.currentItem!.error?.localizedDescription])
            }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…