@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
2 lines (1 loc) • 494 B
JavaScript
import{http as e}from"../../platform/net/http.js";import{ResourceHandler as r}from"./handler.js";class t extends r{constructor(e){super(e,"html"),this.decoder=null}load(r,t){"string"==typeof r&&(r={load:r,original:r}),e.get(r.load,{retry:this.maxRetries>0,maxRetries:this.maxRetries},((e,o)=>{e?t(`Error loading html resource: ${r.original} [${e}]`):t(null,o)}))}openBinary(e){return null!=this.decoder||(this.decoder=new TextDecoder("utf-8")),this.decoder.decode(e)}}export{t as HtmlHandler};