简体   繁体   English

动画 PNG (APNG) 在不受支持的浏览器中回退到 gif?

[英]Animated PNG (APNG) fallback to gif in unsupported browsers?

So apparently APNGs fall back to the first frame for unsupported browsers显然,对于不受支持的浏览器, APNG 会退回到第一帧

But is there a way to make it fall back to a gif in unsupported browsers, like we do for webP?但是有没有办法让它在不受支持的浏览器中回退到 gif,就像我们对 webP 所做的那样?

<picture>
  <source srcset="image.webp" type="image/webp">
  <source srcset="image.jpg" type="image/jpeg">
  <img src="image.jpg">
</picture>

This works!这有效! (I thought it was just because the support for <picture> and animated png are very similar ( here & here ), but it also works in 'UC Browser for Android', which apparently supports <picture> but not APNG) 🎉 (我以为只是因为对<picture>和动画 png 的支持非常相似( here & here ),但它也适用于“UC Browser for Android”,它显然支持<picture>但不支持 APNG)🎉

<picture>
  <source srcset="image.png" type="image/apng">
  <source srcset="image.gif" type="image/gif">
  <img src="image.gif">
</picture>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM