[3.4.0][Opt]全屏视频页添加状态栏

This commit is contained in:
chenfufeng
2023-07-24 16:54:22 +08:00
parent 1d0842adc1
commit 95c1947657

View File

@@ -22,6 +22,7 @@ import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import com.mogo.och.taxi.passenger.R import com.mogo.och.taxi.passenger.R
import com.mogo.och.taxi.passenger.ui.statusview.StatusBarView
import com.mogo.och.taxi.passenger.ui.video.FullVideoUtils import com.mogo.och.taxi.passenger.ui.video.FullVideoUtils
import com.mogo.och.taxi.passenger.utils.ZoomDrawable import com.mogo.och.taxi.passenger.utils.ZoomDrawable
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
@@ -30,6 +31,7 @@ import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
import me.jessyan.autosize.utils.AutoSizeUtils
import java.lang.reflect.Constructor import java.lang.reflect.Constructor
/** /**
@@ -50,6 +52,7 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
private var fullVideoPlayer:ConsultVideoPlayer?=null private var fullVideoPlayer:ConsultVideoPlayer?=null
var smalllPlayer:ConsultVideoPlayer?=null var smalllPlayer:ConsultVideoPlayer?=null
private var statusBarView: StatusBarView? = null
private var currentTime = 0 private var currentTime = 0
@@ -158,39 +161,43 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
override fun changeUiToNormal() { override fun changeUiToNormal() {
super.changeUiToNormal() super.changeUiToNormal()
setViewShowState(fullscreenButton, INVISIBLE) setViewShowState(fullscreenButton, INVISIBLE)
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
} }
override fun changeUiToPreparingShow() { override fun changeUiToPreparingShow() {
super.changeUiToPreparingShow() super.changeUiToPreparingShow()
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
} }
override fun changeUiToPlayingShow() { override fun changeUiToPlayingShow() {
super.changeUiToPlayingShow() super.changeUiToPlayingShow()
setViewShowState(fullscreenButton, VISIBLE) setViewShowState(fullscreenButton, VISIBLE)
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
}
override fun changeUiToPlayingClear() {
super.changeUiToPlayingClear()
this.statusBarView?.visibility = View.GONE
} }
override fun changeUiToPauseShow() { override fun changeUiToPauseShow() {
super.changeUiToPauseShow() super.changeUiToPauseShow()
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
} }
override fun changeUiToPlayingBufferingShow() { override fun changeUiToPlayingBufferingShow() {
super.changeUiToPlayingBufferingShow() super.changeUiToPlayingBufferingShow()
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
} }
override fun changeUiToCompleteShow() { override fun changeUiToCompleteShow() {
super.changeUiToCompleteShow() super.changeUiToCompleteShow()
// TODO:("显示顶部View") this.statusBarView?.visibility = View.VISIBLE
} }
public override fun hideAllWidget() { public override fun hideAllWidget() {
super.hideAllWidget() super.hideAllWidget()
// TODO:("隐藏顶部View") this.statusBarView?.visibility = View.GONE
} }
override fun setProgressAndTime( override fun setProgressAndTime(
@@ -419,6 +426,8 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
frameLayout.setBackgroundColor(Color.BLACK) frameLayout.setBackgroundColor(Color.BLACK)
val lp = LayoutParams(width, height) val lp = LayoutParams(width, height)
frameLayout.addView(gsyVideoPlayer, lp) frameLayout.addView(gsyVideoPlayer, lp)
gsyVideoPlayer.statusBarView = StatusBarView(context)
frameLayout.addView(gsyVideoPlayer.statusBarView)
ActivityUtils.getActivityByContext(context) ActivityUtils.getActivityByContext(context)
FullVideoUtils.showOverlayView(context as Activity,frameLayout,R.style.och_window_anim_alpha) FullVideoUtils.showOverlayView(context as Activity,frameLayout,R.style.och_window_anim_alpha)
gsyVideoPlayer.visibility = INVISIBLE gsyVideoPlayer.visibility = INVISIBLE
@@ -482,10 +491,12 @@ class ConsultVideoPlayer : StandardGSYVideoPlayer {
} }
fun clearFullscreenLayout(gsyVideoPlayer:ConsultVideoPlayer) { fun clearFullscreenLayout(gsyVideoPlayer:ConsultVideoPlayer) {
mIfCurrentIsFullscreen = false if (mIfCurrentIsFullscreen) {
val delay = 100 mIfCurrentIsFullscreen = false
gsyVideoPlayer.smalllPlayer = null val delay = 100
mInnerHandler.postDelayed({ resolveNormalVideoShow(gsyVideoPlayer) }, delay.toLong()) gsyVideoPlayer.smalllPlayer = null
mInnerHandler.postDelayed({ resolveNormalVideoShow(gsyVideoPlayer) }, delay.toLong())
}
} }
private fun resolveNormalVideoShow(gsyVideoPlayer: GSYVideoPlayer) { private fun resolveNormalVideoShow(gsyVideoPlayer: GSYVideoPlayer) {