package com.kuanzhai.driver.utils.view
|
|
import android.content.Context
|
import android.media.AudioManager
|
import android.util.AttributeSet
|
import cn.jzvd.JzvdStd
|
|
|
class CustomJzvd(context: Context?, attrs: AttributeSet?) : JzvdStd(context, attrs) {
|
|
var completionView:CompletionView? = null
|
|
|
override fun onCompletion() {
|
super.onCompletion()
|
if (completionView != null){
|
completionView!!.completion()
|
}
|
}
|
|
override fun onPrepared() {
|
super.onPrepared()
|
if (screen == SCREEN_FULLSCREEN) {
|
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 1, 0)
|
} else {
|
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0)
|
}
|
}
|
|
interface CompletionView{
|
fun completion()
|
}
|
|
|
}
|