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

延时加载 js 报错 #258

Open
chendetong1993 opened this issue Oct 11, 2024 · 1 comment
Open

延时加载 js 报错 #258

chendetong1993 opened this issue Oct 11, 2024 · 1 comment

Comments

@chendetong1993
Copy link

你好, 我在下面的使用场景遇到了bug,希望帮忙看下谢谢。

//异步加载脚本
  async loadScript(url) {
        const scriptElement = document.createElement('script');
        scriptElement.src = url;
        document.head.appendChild(scriptElement);
        await new Promise((resolve, reject) => {
            scriptElement.onload = resolve;
            scriptElement.onerror = reject;
        });
    }

//开始运行
await loadScript('./ezuikit.js');
new window.EZUIKit.EZUIKitPlayer({
      id: "xxxxxxx",
      accessToken: "xxxxxxx",
      url: "xxxxxxx",
      width: 320,
      height: 250,
      handleError: (err) => {
          console.log(err);
      },
      handleSuccess: () => {
      }
  });

控制台输出 错误
(1)Decoder.js:8 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
(2)Decoder.js:8 falling back to ArrayBuffer instantiation

@freeshineit
Copy link
Collaborator

你好, 我在下面的使用场景遇到了bug,希望帮忙看下谢谢。

//异步加载脚本
  async loadScript(url) {
        const scriptElement = document.createElement('script');
        scriptElement.src = url;
        document.head.appendChild(scriptElement);
        await new Promise((resolve, reject) => {
            scriptElement.onload = resolve;
            scriptElement.onerror = reject;
        });
    }

//开始运行
await loadScript('./ezuikit.js');
new window.EZUIKit.EZUIKitPlayer({
      id: "xxxxxxx",
      accessToken: "xxxxxxx",
      url: "xxxxxxx",
      width: 320,
      height: 250,
      handleError: (err) => {
          console.log(err);
      },
      handleSuccess: () => {
      }
  });

控制台输出 错误 (1)Decoder.js:8 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. (2)Decoder.js:8 falling back to ArrayBuffer instantiation

正常情况, 因为服务器不支持 application/wasm, 只能以文件流的方式响应。 报错不影响解码播放

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants