question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[coil-video] Failed to load video on imageView

See original GitHub issue

Describe 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)`

The url of the video

Logs/Screenshots Screenshot

Capture d’écran 2020-07-07 à 18 42 12

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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mamadou94Diopcommented, Jul 8, 2020

I got answers on my doubts, I can close that issue. Thank you!!

1reaction
colinrtwhitecommented, Jul 8, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Coil does not load video frame in Image - Stack Overflow
I'm trying to load video frame from video, provided in previewUrl = "https://<..>.mp4" , but nothings happens. I've tried removing/changing ...
Read more >
Getting Started - Coil
An image loading library for Android backed by Kotlin Coroutines.
Read more >
Image Processing with Coil in Android - Section.io
This tutorial will guide you on how to process images in Android using a fast, lightweight, and powerful open-source library known as Coil....
Read more >
Coil - Modern Image Loading Library | Android Studio Tutorial
In this video I'm going to show you many great features of this library, like easily implementing placeholder/ error image, blur/black-white ...
Read more >
coil-kt - Bountysource
ImageView.load( data: Any?, imageLoader: ImageLoader = context. ... The crash originates from coil-video module & it seems to be a GC issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found