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

约定的图片地址实际资源为视频时,在列表中加载这种资源,内存激增导致 App 闪退。 #2221

Open
liyunxin opened this issue Mar 15, 2024 · 2 comments
Assignees

Comments

@liyunxin
Copy link

喵神大佬,希望可以指点一下,在事先无法知道资源的类型,在KF里面有判断到资源为视频不是图片的时候直接返回 placeholder 的方法吗?

@onevcat
Copy link
Owner

onevcat commented Mar 15, 2024

无论如何都是需要发生一次HTTP请求的。Kingfisher并没有预先检查这些,所以需要自己实现一下。如果你的server端实现正确的话,可以向资源URI发一个HEAD请求,通过检查header 的 content type来判断到底是视频还是图片(当然,前提是你的server返回的这个值是正确的),然后再决定后续使用 Kingfisher 的方式和逻辑。

@onevcat
Copy link
Owner

onevcat commented Mar 18, 2024

TASK: Consider to add a header check when receiving the first data chunk (or header). Early fails with an error if the expected type cannot be handled.

@onevcat onevcat self-assigned this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants