[M2] 视频首帧加载默认本地图片
This commit is contained in:
@@ -45,13 +45,14 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
initVideoView()
|
||||
initCacheImgView()
|
||||
initVideoView()
|
||||
}
|
||||
|
||||
private fun initCacheImgView() {
|
||||
cacheImage = ImageView(context)
|
||||
cacheImage?.scaleType = ImageView.ScaleType.FIT_XY
|
||||
cacheImage?.setImageResource(R.drawable.m2_p_video_holder)
|
||||
}
|
||||
|
||||
private fun initVideoView() {
|
||||
@@ -87,24 +88,23 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun loadCacheImg() {
|
||||
// BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*/
|
||||
cacheImage?.setImageResource(R.drawable.m2_p_video_holder)
|
||||
// BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*
|
||||
setCacheImageViewVisible()
|
||||
// OCHThreadPoolManager.getsInstance().execute {
|
||||
// var bitmap = BitmapHelper.getVideoThumbnail(fileNetPath)
|
||||
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)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user