svga / SVGAPlayer-Web

Similar to Lottie. Render After Effects / Animate CC (Flash) animations natively on Android and iOS, Web. 使用 SVGAPlayer 在 Android、iOS、Web中播放 After Effects / Animate CC (Flash) 动画。
https://svga.io
Apache License 2.0
954 stars 239 forks source link

bugfix(loadAssets): Fix the problem that failing at requsting a base6… #134

Open voezy opened 3 years ago

voezy commented 3 years ago

Fix the problem that failing at requsting a base64 string as the src param of xhr.open in Internet Explorer.

处理IE无法使用base64字符串作为请求地址发起 xhr 请求的问题。 使用webpack打包后的base64时,若没有引入//s1.yy.com/ued_web_static/lib/jszip/3.1.4/??jszip.min.js,jszip-utils.min.js, 则在执行parser.load(base64string)后,会使用以下逻辑加载svga,

const req = new XMLHttpRequest()
req.open("GET", base64string, true);

这段逻辑在 chromium 内核的浏览器中可以正常运行,但在IE中会出现"拒绝访问"的问题,因此参考程序原有相关逻辑,作出这个修改,对base64字符串不在xhr中进行处理(考虑到不希望另外引入多一个js的情况下)。希望可以考虑下是否并入此修改。