Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -673,13 +673,11 @@ class GameDetailFragment : NormalFragment() {
|
||||
mTopVideoView.video = topVideo
|
||||
mTopVideoView.updateThumb(topVideo.poster)
|
||||
|
||||
val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
|
||||
if (NetworkUtils.isWifiConnected(requireContext()) || !trafficVideo) {
|
||||
//val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
|
||||
if (NetworkUtils.isWifiConnected(requireContext()) /*|| !trafficVideo*/) {
|
||||
if (mViewModel.isTopVideoPartlyCached(topVideo.url)) {
|
||||
mBaseHandler.postDelayed({ mTopVideoView.updateMuteStatus() }, 500)
|
||||
mTopVideoView.startPlayLogic(isAutoPlay = true)
|
||||
} else {
|
||||
mBaseHandler.postDelayed({ mTopVideoView.updateMuteStatus() }, INITIAL_DELAY + 500)
|
||||
// 未有缓存时,为避免影响页面加载,延迟自动播放视频
|
||||
postDelayedRunnable({
|
||||
if (activity != null && activity?.isFinishing != true) {
|
||||
|
||||
@ -119,6 +119,7 @@ class TopVideoView @JvmOverloads constructor(context: Context, attrs: AttributeS
|
||||
}
|
||||
|
||||
fun startPlayLogic(isAutoPlay: Boolean) {
|
||||
postDelayed({ updateMuteStatus() }, 500)
|
||||
DownloadManager.getInstance(context).updateSpeedLimitationReleaseDelay(5)
|
||||
if (isAutoPlay) {
|
||||
MtaHelper.onEvent("游戏详情_顶部视频", "视频播放方式", "自动播放")
|
||||
@ -194,17 +195,17 @@ class TopVideoView @JvmOverloads constructor(context: Context, attrs: AttributeS
|
||||
// 不需要弹弹窗,直接播放
|
||||
override fun showWifiDialog() {
|
||||
startPlayLogic(false)
|
||||
val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
|
||||
//val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
|
||||
//if (trafficVideo) {
|
||||
// 不延迟的话 isCacheFile 可能直接返回 false
|
||||
if (trafficVideo) {
|
||||
postDelayed({
|
||||
if (!NetworkUtils.isAvailable(mContext) && !GSYVideoManager.instance().isCacheFile) {
|
||||
Utils.toast(context, "网络异常,请检查手机网络状态")
|
||||
} else if (!NetworkUtils.isWifiConnected(mContext) && !GSYVideoManager.instance().isCacheFile) {
|
||||
Utils.toast(context, "当前为非Wi-Fi环境,请注意流量消耗")
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
postDelayed({
|
||||
if (!NetworkUtils.isAvailable(mContext) && !GSYVideoManager.instance().isCacheFile) {
|
||||
Utils.toast(context, "网络异常,请检查手机网络状态")
|
||||
} else if (!NetworkUtils.isWifiConnected(mContext) && !GSYVideoManager.instance().isCacheFile) {
|
||||
Utils.toast(context, "当前为非Wi-Fi环境,请注意流量消耗")
|
||||
}
|
||||
}, 100)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +257,7 @@ class TopVideoView @JvmOverloads constructor(context: Context, attrs: AttributeS
|
||||
replayIv.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏详情_顶部视频", "${getMtaKeyPrefix()}-点击重新播放", combinedTitleAndId)
|
||||
startButton.performClick()
|
||||
postDelayed({updateMuteStatus()},500)
|
||||
postDelayed({ updateMuteStatus() }, 500)
|
||||
}
|
||||
updateThumb(video!!.poster)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user