1 Star 0 Fork 0

studvc/coil

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Video Frames

To add video frame support, import the extension library:

implementation("io.coil-kt:coil-video:1.0.0-rc3")

And add the two fetchers to your component registry when constructing your ImageLoader:

val imageLoader = ImageLoader.Builder(context)
    .componentRegistry {
         add(VideoFrameFileFetcher())
         add(VideoFrameUriFetcher())
    }
    .build()

!!! Note Video frame decoding is only supported for Files and Uris (content and file schemes only).

To specify the time code of the frame to extract from a video, use videoFrameMillis or videoFrameMicros:

imageView.load(File("/path/to/video.mp4")) {
    videoFrameMillis(1000)
}

If a frame time isn't specified, the first frame of the video is decoded.

The ImageLoader will automatically detect any videos and extract their frames if the request's filename/URI ends with a valid video extension. If it does not, you can set the Fetcher explicitly for the request.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/studvc/coil.git
git@gitee.com:studvc/coil.git
studvc
coil
coil
master

搜索帮助