Closed mamadou94Diop closed 4 years ago
I am sorry !! By mistake I submitted the issue without finishing fill the form
Hmm it looks like the logs didn't capture the exception. Can you add logger(DebugLogger()
to your ImageLoader
and re-run the code and post the exception? The stack trace should be logged with the tag RealImageLoader
.
Indeed, you were right! By adding that line in my image loader creation, the exception was displayed.
2020-07-08 10:01:59.084 17524-17524/com.mjob.coilexperiment I/RealImageLoader: 🚨 Failed - http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4 - java.lang.IllegalArgumentException: could not access http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4 2020-07-08 10:01:59.087 17524-17524/com.useradgents.coilexperiment E/RealImageLoader: java.lang.IllegalArgumentException: could not access http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4 at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:342) at coil.fetch.VideoFrameUriFetcher.setDataSource(VideoFrameFetcher.kt:63) at coil.fetch.VideoFrameUriFetcher.setDataSource(VideoFrameFetcher.kt:48) at coil.fetch.VideoFrameFetcher.fetch$suspendImpl(VideoFrameFetcher.kt:99) at coil.fetch.VideoFrameFetcher.fetch(Unknown Source:0) at coil.RealImageLoader$loadData$2.invokeSuspend(RealImageLoader.kt:327) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
It does not manage to access to this video url meanwhile this is a valid uri with a file having compatible extension, I tried with another video : http://videocdn.bodybuilding.com/video/mp4/62000/62792m.mp4 with the same exception thrown. By the way, my intent is just to do a poc showing that lib handles easily gif, image and video. So if you have a good URI for video, I am willing to take it.
Maybe it's due to using HTTP instead of HTTPS? Either way, Coil only supports decoding video frames from local files/uris. If you need a video to test, you could copy the video from the sample app.
Yesterday I cheated by replacing that url by HTTPS but I got the same error. So can we expect a disclaimer on documentation section about video frames stating that currently remote video frames access is not possible?
There's already a disclaimer in the docs: Video frame decoding is only supported for Files and Uris (content and file schemes only).
My bad. So can we expect in future releases to support remote URIs with HTTP/HTTPS schemes ?
Unfortunately, I don't think it's likely. If you're interested, I wrote up my thoughts here, but basically the Android APIs require a local file and Coil intentionally abstracts the data source from the Decoder
.
I got answers on my doubts, I can close that issue. Thank you!!
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.
I used my own ImageView extension.
The url of the video
Logs/Screenshots Screenshot
Logs
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