bytedance / xgplayer

A HTML5 video player with a parser that saves traffic
https://h5player.bytedance.com/
MIT License
8.36k stars 871 forks source link

hls地址解析bug #723

Closed wells1013 closed 1 year ago

wells1013 commented 2 years ago

您使用的西瓜播放器版本是多少? What version of xgplayer are you using? xgplayer: 2.31.4 xgplayer-hls: 2.5.1

您使用的操作系统和浏览器分别是? What OS and browser are you using? chrome, mac os

如何复现问题? What did you do? 在 演示地址里 https://v2.h5player.bytedance.com/examples/ 播放hls 视频地址: 下面地址 https://video.yunjilink.com/recordings/z1.yunji-live.5f1f8f79d384c73704e272bb/1596092571_1596095882.m3u8

a1CHAX_1650274977245_5fJmrc

实际播放器的表现是? What actually happened? 通过 hls.js 播放 ok 通过西瓜hls 播放 失败

从日志看 ts 的解析有点问题 将地址 “http://video.yunjilink.com/fragments/z1.yunji-live.5f1f8f79d384c73704e272bb/1596092565888-1596092574222.ts” 错误的解析成 “http://video.yunjilink.com/recordings/z1.yunji-live.5f1f8f79d384c73704e272bb/fragments/z1.yunji-live.5f1f8f79d384c73704e272bb/1596092565888-1596092574222.ts

m3u8 的 ts 地址解析有点问题。请问如何解决此问题。 谢谢

wells1013 commented 2 years ago

我看到 包 xgplayer-helper-transmuxers 的 lib/hls/m3u8.js中 ts url 匹配有问题。 https://zhuanlan.zhihu.com/p/358217465

下面的这段代码 解析有点武断

if (nextline.match(/.*:\/\/.*/)) {
    var isHTTPS = M3U8Parser.isHTTPS;
    if ((M3U8Parser.envisHttps || (M3U8Parser.envisHttps = isHTTPS(window.location.href))) && !isHTTPS(nextline)) {
      nextline = nextline.replace('http:', 'https:');
    }
    frag.url = nextline;
  } else {
    frag.url = baseurl + nextline;
  }
leonardoFu commented 2 years ago

已经修复,请使用xgplayer-hls 2.5.2版本

leafhina commented 2 years ago

已经修复,请使用xgplayer-hls 2.5.2版本

没有解决,key的加载同样存在地址判断问题,m3u8文件的key如果是相对路径,会直接用location加载,而不是source url

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 1 year ago

This issue has been automatically closed after a period of inactivity. If it is still present in the latest release, please create a new issue with up-to-date information. Thank you!