[M2] 视频默认图片加载网络图片

This commit is contained in:
wangmingjun
2023-03-09 00:26:59 +08:00
parent 35192ca1ed
commit 167c78c49c

View File

@@ -14,7 +14,9 @@ import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.constant.BusPassengerConst.Companion.DOWNLOAD_DELAY
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import java.io.File
@@ -96,16 +98,16 @@ class AdvanceVideoView @JvmOverloads constructor(
Logger.d(ImageAndVideoRotation.TAG, "setVideoPath")
// ThreadUtils.runOnUiThread {
// Logger.d(ImageAndVideoRotation.TAG, "bitmap加载")
// cacheImage?.let {
// Glide.with(context).load(cacheImageUrl)
// .apply(
// RequestOptions().placeholder(R.drawable.m2_p_video_holder)
// .error(R.drawable.m2_p_video_holder)
// .fallback(R.drawable.m2_p_video_holder)
// .centerCrop()
// )
// .into(it)
// }
cacheImage?.let {
Glide.with(context).load(cacheImageUrl)
.apply(
RequestOptions().placeholder(R.drawable.m2_p_video_holder)
.error(R.drawable.m2_p_video_holder)
.fallback(R.drawable.m2_p_video_holder)
.centerCrop()
)
.into(it)
}
// }
// }
}
@@ -196,6 +198,10 @@ class AdvanceVideoView @JvmOverloads constructor(
override fun onPause(url: String?, threadBean: ThreadBean?) {
Logger.d(ImageAndVideoRotation.TAG, "download-onPause")
// UiThreadHandler.postDelayed(Runnable {
// startDownLoadVideo()
// },DOWNLOAD_DELAY)
// todo 测试下网络断掉是否会走opause且网络回复也不会继续下载
}
override fun onProgress(url: String?, length: Int) {