Open liyunxin opened 6 months ago
无论如何都是需要发生一次HTTP请求的。Kingfisher并没有预先检查这些,所以需要自己实现一下。如果你的server端实现正确的话,可以向资源URI发一个HEAD请求,通过检查header 的 content type来判断到底是视频还是图片(当然,前提是你的server返回的这个值是正确的),然后再决定后续使用 Kingfisher 的方式和逻辑。
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.
喵神大佬,希望可以指点一下,在事先无法知道资源的类型,在KF里面有判断到资源为视频不是图片的时候直接返回 placeholder 的方法吗?