NoisyAudioStreamReceiver.kt 435 Bytes
Newer Older
konghaorui committed
1
package com.ydl.media.audio.receiver
konghaorui committed
2 3 4 5 6

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

konghaorui committed
7
import com.ydl.media.audio.AudioPlayer
konghaorui committed
8 9 10 11 12 13 14 15 16 17 18 19


/**
 * Created by haorui on 2019-10-27 .
 * Des: 来电/耳机拔出时暂停播放
 */
class NoisyAudioStreamReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        AudioPlayer.get().playPause()
    }
}