[coil-video] Failed to load video on imageView
See original GitHub issueDescribe the bug I have a recycler view with 3 elements : an image , a gif and a video. But the video does not work and display first the placeholder and after the error drawables.
Expected behavior The item of my recycler view should display video as same as image and gif which worked well. To Reproduce How can we reproduce this? I injected the image loader as a dependency through Dagger.
@Singleton
@Provides
fun providesImageLoader(context: Context) :ImageLoader {
return ImageLoader.Builder(context)
.availableMemoryPercentage(0.5)
.crossfade(true)
.crossfade(2000)
.placeholder(R.drawable.placeholder)
.error(R.drawable.error)
.componentRegistry {
add(VideoFrameFileFetcher(context))
add(VideoFrameUriFetcher(context))
if (Build.VERSION.SDK_INT >= 28) {
add(ImageDecoderDecoder())
} else {
add(GifDecoder())
}
}
.build()
}
I used my own ImageView extension.
fun ImageView.load(uri: String, imageLoader: ImageLoader){
val request = LoadRequest.Builder(context)
.data(uri)
.target(this)
.scale(Scale.FIT)
.build()
imageLoader.execute(request)`
Logs/Screenshots Screenshot

Logs
2020-07-07 18:13:51.683 16572-16572/? I/.coilexperimen: Not late-enabling -Xcheck:jni (already on) 2020-07-07 18:13:51.704 16572-16572/? I/.coilexperimen: Unquickening 12 vdex files! 2020-07-07 18:13:51.708 16572-16572/? W/.coilexperimen: Unexpected CPU variant for X86 using defaults: x86 2020-07-07 18:13:51.928 16572-16572/com.mjob.coilexperiment D/NetworkSecurityConfig: No Network Security Config specified, using platform default 2020-07-07 18:13:51.928 16572-16572/com.mjob.coilexperiment D/NetworkSecurityConfig: No Network Security Config specified, using platform default 2020-07-07 18:13:51.950 16572-16597/com.mjob.coilexperiment D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so 2020-07-07 18:13:51.959 16572-16597/com.mjob.coilexperiment D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so 2020-07-07 18:13:51.966 16572-16597/com.mjob.coilexperiment D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so 2020-07-07 18:13:52.039 16572-16572/com.mjob.coilexperiment I/TetheringManager: registerTetheringEventCallback:com.mjob.coilexperiment 2020-07-07 18:13:52.103 16572-16572/com.mjob.coilexperiment W/.coilexperimen: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 2020-07-07 18:13:52.104 16572-16572/com.mjob.coilexperiment W/.coilexperimen: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 2020-07-07 18:13:52.150 16572-16595/com.mjob.coilexperiment D/HostConnection: HostConnection::get() New Host Connection established 0xee053030, tid 16595 2020-07-07 18:13:52.169 16572-16595/com.mjob.coilexperiment D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0 2020-07-07 18:13:52.174 16572-16595/com.mjob.coilexperiment W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without… 2020-07-07 18:13:52.176 16572-16595/com.mjob.coilexperiment D/EGL_emulation: eglCreateContext: 0xedea9f30: maj 3 min 0 rcv 3 2020-07-07 18:13:52.177 16572-16595/com.mjob.coilexperiment D/EGL_emulation: eglMakeCurrent: 0xedea9f30: ver 3 0 (tinfo 0xee1b2d90) (first time) 2020-07-07 18:13:52.193 16572-16595/com.mjob.coilexperiment I/Gralloc4: mapper 4.x is not supported 2020-07-07 18:13:52.196 16572-16595/com.mjob.coilexperiment D/HostConnection: createUnique: call 2020-07-07 18:13:52.197 16572-16595/com.mjob.coilexperiment D/HostConnection: HostConnection::get() New Host Connection established 0xee052970, tid 16595 2020-07-07 18:13:52.197 16572-16595/com.mjob.coilexperiment D/eglCodecCommon: allocate: Ask for block of size 0x100 2020-07-07 18:13:52.215 16572-16595/com.mjob.coilexperiment D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3fdbe2000 size 0x2000 2020-07-07 18:13:52.234 16572-16595/com.mjob.coilexperiment D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
Version Android 30 io.coil-kt:coil-base:0.11.0 io.coil-kt:coil-video:0.11.0 Device is a Pixel 3A XL virtual device
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
I got answers on my doubts, I can close that issue. Thank you!!
There’s already a disclaimer in the docs:
Video frame decoding is only supported for Files and Uris (content and file schemes only).