goldvideo / h265player

一套完整的Web版H.265播放器解决方案,非常适合学习交流和实际应用。基于JS码流解封装、WebAssembly(FFmpeg)视频解码,利用Canvas画布投影、AudioContext播放音频。
https://goldvideo.github.io/h265player/
1.53k stars 298 forks source link

HLS(m3u8)不支持多级的index吗?试了下报错了Parse playlist error. #69

Open apm29 opened 3 years ago

apm29 commented 3 years ago

用的demo.html,改成自己的HLS地址,m3u8文件的内容如下:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=2000000
/playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8

错误信息:

goldplay-h265-sdk.js:formatted:399 Error: [GOLDPLAY ERROR:default-1001]0
    at e.value (goldplay-h265-sdk.js:formatted:396)
    at n.<anonymous> (goldplay-h265-sdk.js:formatted:11939)
    at goldplay-h265-sdk.js:formatted:1558
    at Array.forEach (<anonymous>)
    at e.value (goldplay-h265-sdk.js:formatted:1557)
    at n.value (goldplay-h265-sdk.js:formatted:2925)
    at Worker.httpWorker.onmessage (goldplay-h265-sdk.js:formatted:2904) "[message]:" "0" "[args]:" 
(3) ["Parse playlist error.", "data:", e]
0: "Parse playlist error."
1: "data:"
2: e {source: "#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=2000000\n/playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8\n", segments: Array(0), _currentSegment: null, discontinuous: false, tags: {…}, …}
length: 3
yiwen03 commented 3 years ago

嗯,不支持多级的

------------------ 原始邮件 ------------------ 发件人: apm29 @.> 发送时间: 2021年8月16日 16:49 收件人: goldvideo/h265player @.> 抄送: Subscribed @.***> 主题: 回复:[goldvideo/h265player] HLS(m3u8)不支持多级的index吗?试了下报错了Parse playlist error. (#69)

用的demo.html,改成自己的HLS地址,m3u8文件的内容如下:

EXTM3U #EXT-X-STREAM-INF:BANDWIDTH=2000000 /playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8

错误信息: goldplay-h265-sdk.js:formatted:399 Error: [GOLDPLAY ERROR:default-1001]0 at e.value (goldplay-h265-sdk.js:formatted:396) at n.<anonymous> (goldplay-h265-sdk.js:formatted:11939) at goldplay-h265-sdk.js:formatted:1558 at Array.forEach (<anonymous>) at e.value (goldplay-h265-sdk.js:formatted:1557) at n.value (goldplay-h265-sdk.js:formatted:2925) at Worker.httpWorker.onmessage (goldplay-h265-sdk.js:formatted:2904) "[message]:" "0" "[args]:" (3) ["Parse playlist error.", "data:", e] 0: "Parse playlist error." 1: "data:" 2: e {source: "#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=2000000\n/playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8\n", segments: Array(0), _currentSegment: null, discontinuous: false, tags: {…}, …} length: 3
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

seven-cm commented 2 years ago

自行修改 getBaseUrl(file) 应该可以支持到

seven-cm commented 2 years ago
  getBaseUrl(file) {
    const sourceURL = this.options.sourceURL;
    const isAbsolute = file.indexOf("//") > -1;
    if (!isAbsolute) {
      const isAbsoultStart = file.indexOf("/") == 0;
      if (isAbsoultStart) {
        //sourceURL.replace(/^https?://[^/]*/,'$1')
        return sourceURL.match(/^https?:\/\/[^\/]*/g)[0];
      } else {
        const lastSlash = sourceURL.lastIndexOf("/");
        return sourceURL.substr(0, lastSlash + 1);
      }
    }
    return "";
  }
katfionn commented 6 months ago

嗯,不支持多级的 ------------------ 原始邮件 ------------------ 发件人: apm29 @.> 发送时间: 2021年8月16日 16:49 收件人: goldvideo/h265player @.> 抄送: Subscribed @.***> 主题: 回复:[goldvideo/h265player] HLS(m3u8)不支持多级的index吗?试了下报错了Parse playlist error. (#69) 用的demo.html,改成自己的HLS地址,m3u8文件的内容如下: #EXTM3U #EXT-X-STREAM-INF:BANDWIDTH=2000000 /playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8 错误信息: goldplay-h265-sdk.js:formatted:399 Error: [GOLDPLAY ERROR:default-1001]0 at e.value (goldplay-h265-sdk.js:formatted:396) at n.<anonymous> (goldplay-h265-sdk.js:formatted:11939) at goldplay-h265-sdk.js:formatted:1558 at Array.forEach (<anonymous>) at e.value (goldplay-h265-sdk.js:formatted:1557) at n.value (goldplay-h265-sdk.js:formatted:2925) at Worker.httpWorker.onmessage (goldplay-h265-sdk.js:formatted:2904) "[message]:" "0" "[args]:" (3) ["Parse playlist error.", "data:", e] 0: "Parse playlist error." 1: "data:" 2: e {source: "#EXTM3U\n#EXT-X-STREAM-INF:BANDWIDTH=2000000\n/playlist/d268a4dbccba639f4dfc457bbb46f1ff.m3u8\n", segments: Array(0), _currentSegment: null, discontinuous: false, tags: {…}, …} length: 3 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

大佬,什么叫多级,我把demo.html里这个“rateList:”这里块给注释掉了,就切换清晰度那个功能,这个就是你们说的“多级”吗