refactor: 将明君优化的宣传视频播放优化复制到公共module;
This commit is contained in:
@@ -522,7 +522,7 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer {
|
||||
hideWidget()
|
||||
}
|
||||
|
||||
private fun hideWidget() {
|
||||
private fun hideWidget(){
|
||||
setViewShowState(mBottomContainer, INVISIBLE)
|
||||
setViewShowState(mProgressBar, INVISIBLE)
|
||||
setViewShowState(mCurrentTimeTextView, INVISIBLE)
|
||||
@@ -535,22 +535,19 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer {
|
||||
setViewShowState(
|
||||
mLockScreen, INVISIBLE
|
||||
)
|
||||
|
||||
setIsTouchWiget(false)
|
||||
isFocusableInTouchMode = false
|
||||
}
|
||||
|
||||
fun setCacheImageViewVisible() {
|
||||
if (mThumbImageViewLayout.visibility == INVISIBLE) {
|
||||
setViewShowState(mThumbImageViewLayout, VISIBLE)
|
||||
setViewShowState(mThumbImageView, VISIBLE)
|
||||
}
|
||||
setViewShowState(mThumbImageViewLayout, VISIBLE)
|
||||
setViewShowState(mThumbImageView, VISIBLE)
|
||||
}
|
||||
|
||||
fun setCacheImageViewGone() {
|
||||
if (mThumbImageViewLayout.visibility == VISIBLE) {
|
||||
setViewShowState(mThumbImageViewLayout, INVISIBLE)
|
||||
setViewShowState(mThumbImageView, INVISIBLE)
|
||||
}
|
||||
setViewShowState(mThumbImageViewLayout, INVISIBLE)
|
||||
setViewShowState(mThumbImageView, INVISIBLE)
|
||||
}
|
||||
|
||||
//失去焦点声音压低
|
||||
@@ -563,17 +560,17 @@ class AdvanceGSYVideoPlayer : StandardGSYVideoPlayer {
|
||||
setNeedMute(false)
|
||||
}
|
||||
|
||||
private fun setStreamVolume(percent: Float) {
|
||||
private fun setStreamVolume(percent: Float){
|
||||
var mAudioManager = mContext?.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
var maxVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
var volume = (percent * maxVolume).toInt()
|
||||
if (volume < 0) {
|
||||
if (volume < 0 ){
|
||||
volume = 0
|
||||
}
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0)
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0)
|
||||
}
|
||||
|
||||
private fun setNeedMute(isMute: Boolean) {
|
||||
private fun setNeedMute(isMute: Boolean){
|
||||
gsyVideoManager?.player?.setNeedMute(isMute)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user