[M2]关闭线程优化,视频视频播放生命周期处理

This commit is contained in:
wangmingjun
2023-03-14 17:05:13 +08:00
parent 84a6795575
commit 47fb68c6da
2 changed files with 23 additions and 12 deletions

View File

@@ -24,34 +24,45 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
}
override fun hideAllWidget() {
hideWidget()
Logger.d(ImageAndVideoRotation.TAG, "hideAllWidget")
// hideWidget()
}
override fun changeUiToNormal() {
Debuger.printfLog("changeUiToNormal")
Logger.d(ImageAndVideoRotation.TAG, "changeUiToNormal-hide")
hideWidget()
}
override fun changeUiToPreparingShow() {
Logger.d(ImageAndVideoRotation.TAG, "changeUiToPreparingShow-hide")
hideWidget()
}
override fun changeUiToPlayingShow() {
hideWidget()
Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingShow")
setCacheImageViewGone()
}
override fun changeUiToPauseShow() {
Logger.d(ImageAndVideoRotation.TAG, "changeUiToPauseShow-hide")
hideWidget()
}
override fun changeUiToCompleteShow() {
hideWidget()
Logger.d(ImageAndVideoRotation.TAG, "changeUiToCompleteShow")
setCacheImageViewGone()
}
override fun changeUiToPlayingBufferingShow() {
Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingBufferingShow -hide")
hideWidget()
}
override fun changeUiToError() {
Logger.d(ImageAndVideoRotation.TAG, "changeUiToError-hide")
hideWidget()
}
private fun hideWidget(){
setViewShowState(mBottomContainer, INVISIBLE)
setViewShowState(mProgressBar, INVISIBLE)
@@ -61,8 +72,8 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
setViewShowState(mBackButton, INVISIBLE)
setViewShowState(mStartButton, INVISIBLE)
// setViewShowState(mThumbImageViewLayout, INVISIBLE)
// setViewShowState(mThumbImageView, INVISIBLE)
setViewShowState(mThumbImageViewLayout, VISIBLE)
setViewShowState(mThumbImageView, VISIBLE)
setViewShowState(mTopContainer, INVISIBLE)
@@ -78,13 +89,13 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
fun setCacheImageViewVisible() {
Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewVISIBLE")
setViewShowState(mThumbImageViewLayout, VISIBLE)
setViewShowState(mThumbImageView, VISIBLE)
// setViewShowState(mThumbImageView, VISIBLE)
}
fun setCacheImageViewGone() {
Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewGONE")
setViewShowState(mThumbImageViewLayout, INVISIBLE)
setViewShowState(mThumbImageView, INVISIBLE)
// setViewShowState(mThumbImageView, INVISIBLE)
}
//失去焦点声音压低

View File

@@ -15,8 +15,8 @@ def isReleaseBuild = isReleaseBuild()
if (!isAndroidTestBuild()) {
apply plugin: 'bytex'
ByteX {
enable false
enableInDebug false
enable true
enableInDebug true
logLevel "DEBUG"
}
}
@@ -42,8 +42,8 @@ if (!isAndroidTestBuild()) {
if (!isAndroidTestBuild()) {
apply plugin: 'bytex.threadOpt'
thread_opt {
enable true
enableInDebug true
enable false
enableInDebug false
logLevel "DEBUG"
}
}