修复release混淆后,程序运行时序异常导致崩溃的问题
This commit is contained in:
parent
b491186524
commit
b4a2bf3410
|
|
@ -39,7 +39,7 @@ class VersionActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
|||
|
||||
|
||||
// For Testing
|
||||
val shouldShowDebug = true//BuildConfig.DEBUG
|
||||
val shouldShowDebug = false//BuildConfig.DEBUG
|
||||
llTesting.isVisible = shouldShowDebug
|
||||
if (shouldShowDebug) {
|
||||
butCash.setOnClickListener {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.YouTubePlayer
|
|||
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.AbstractYouTubePlayerListener
|
||||
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.YouTubePlayerCallback
|
||||
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.utils.loadOrCueVideo
|
||||
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.options.IFramePlayerOptions
|
||||
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
|
||||
import com.viddin.videos.free.databinding.VididinappFeatureHomeItemLayoutBinding as ViewBinding
|
||||
|
||||
|
|
@ -177,16 +178,20 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
|||
layoutParam.gravity = Gravity.BOTTOM
|
||||
binding!!.playerContainer.addView(mPlayerView, layoutParam)
|
||||
lifecycle.addObserver(mPlayerView!!)
|
||||
mPlayerView?.enableAutomaticInitialization = true
|
||||
}
|
||||
mPlayerView?.enableAutomaticInitialization = false
|
||||
|
||||
// val playerUiController = MyPlayerControlView(mPlayerView!!)
|
||||
// mPlayerView!!.setCustomPlayerUi(playerUiController.rootView)
|
||||
mPlayerView!!.removeViews(1, mPlayerView!!.childCount - 1)
|
||||
val iFramePlayerOptions = IFramePlayerOptions.Builder(requireActivity())
|
||||
.controls(0)
|
||||
.rel(0)
|
||||
.ivLoadPolicy(3)
|
||||
.ccLoadPolicy(1)
|
||||
.build()
|
||||
|
||||
mPlayerView!!.addYouTubePlayerListener(object : AbstractYouTubePlayerListener() {
|
||||
mPlayerView!!.initialize(object : AbstractYouTubePlayerListener() {
|
||||
override fun onReady(youTubePlayer: YouTubePlayer) {
|
||||
mPlayer = youTubePlayer
|
||||
val playerUiController = MyPlayerControlView(mPlayerView!!)
|
||||
mPlayerView!!.setCustomPlayerUi(playerUiController.rootView)
|
||||
|
||||
if (mPendingPlay) {
|
||||
mPlayer?.loadVideo(mVideoData!!.id, mCurPlayedSecond)
|
||||
|
|
@ -253,7 +258,8 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}, true, iFramePlayerOptions)
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendPlayStopStatistic(isPlayStart: Boolean) {
|
||||
|
|
@ -285,7 +291,15 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
|||
// binding?.circlePb?.isVisible = false
|
||||
// }
|
||||
|
||||
binding?.ivMask?.isVisible = !mIsPlaying
|
||||
if (mIsPlaying) {
|
||||
// Delay hiding mask to prevent seeing loading controls
|
||||
binding?.ivMask?.postDelayed({
|
||||
if (mIsPlaying) binding?.ivMask?.isVisible = false
|
||||
}, 500)
|
||||
} else {
|
||||
binding?.ivMask?.isVisible = true
|
||||
}
|
||||
|
||||
// Ensure playerContainer is visible when playing OR preloading (masked)
|
||||
binding?.playerContainer?.isVisible = mIsPlaying || mIsPreloading
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ abstract class BaseTaskHelper<T: Any, C: Any> {
|
|||
return mStateBean
|
||||
}
|
||||
|
||||
fun isReady(): Boolean {
|
||||
return this::mStateBean.isInitialized
|
||||
}
|
||||
|
||||
fun release() {
|
||||
NotifyMan.instance().unregister(mEventCallback)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
|||
}
|
||||
|
||||
fun getCurrentBoxStartTimeMs(): Long {
|
||||
if (!isReady()) return 0L
|
||||
return mStateBean.boxList[mStateBean.currentBoxIndex].boxStartMs
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
vidiDinKey
BIN
vidiDinKey
Binary file not shown.
Loading…
Reference in New Issue