Skip to content

Support extracting video image by frame index#2183

Merged
colinrtwhite merged 7 commits into
coil-kt:mainfrom
tnj:video-index-support
Mar 28, 2024
Merged

Support extracting video image by frame index#2183
colinrtwhite merged 7 commits into
coil-kt:mainfrom
tnj:video-index-support

Conversation

@tnj
Copy link
Copy Markdown
Contributor

@tnj tnj commented Mar 26, 2024

This fixes #2180.

This changeset adds the videoFrameIndex option to the VideoFrameDecoder, which allows extracting an image from videos by its index (frame number).

* When both [videoFrameIndex] and other videoFrame-prefixed properties are set,
* [videoFrameIndex] will take precedence.
*/
fun ImageRequest.Builder.videoFrameIndex(frameIndex: Int) = apply {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's annotate these methods with @RequiresApi(28) since they need API 28 to work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. I've added it to the README too.

Copy link
Copy Markdown
Member

@colinrtwhite colinrtwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for implementing this. Left one comment.

@colinrtwhite colinrtwhite merged commit 5590b8b into coil-kt:main Mar 28, 2024
@tnj tnj deleted the video-index-support branch March 29, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support retrieving video image by frame index on VideoFrameDecoder

2 participants