Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么要默认循环播放,是出于什么考虑? #103

Closed
liujingxing opened this issue Nov 1, 2022 · 3 comments
Closed

为什么要默认循环播放,是出于什么考虑? #103

liujingxing opened this issue Nov 1, 2022 · 3 comments

Comments

@liujingxing
Copy link

liujingxing commented Nov 1, 2022

我看WebpDrawable构造方法是可以拿到Webp图片自身的loopCount,当这个loopCount大于0时,赋值给maxLoopCount是否更为合理,如下:

WebpDrawable(WebpState state) {
    this.isVisible = true;
    int intrinsicCount = state.frameLoader.getLoopCount();
    this.maxLoopCount = intrinsicCount > 0 ? intrinsicCount : LOOP_FOREVER;
    this.state = Preconditions.checkNotNull(state);
}

现在我想仅播放一次的话,还是略微有点麻烦,我大部分场景webp自身的loopCount都等于1

@zjupure
Copy link
Owner

zjupure commented Nov 6, 2022

跟GifDrawable行为对齐的,大部分webp都没有设置loopCount

@liujingxing
Copy link
Author

感觉很不合理,如果是这样的话,webp自带的loopCount就没有多大的意义;
顺便说下,Fresco就是优先取webp自带的loopCount,如果可以的话,还是希望支持下。

@zjupure
Copy link
Owner

zjupure commented Nov 14, 2022

如果fresco用的webp自带的loopCount,可以优化对齐,可以提个修复MR

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

No branches or pull requests

2 participants