bytedance / xgplayer

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

在使用xgplayer-hls.js做plugin的时候,config中使用hlsOpts不生效 #1521

Closed MonsterXue closed 2 weeks ago

MonsterXue commented 2 weeks ago

您使用的西瓜播放器版本是多少? What version of xgplayer are you using? xgplayer@3.0.10 xgplayer-hls.js@3.0.10

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

如何复现问题? How to reproduce the problem? 使用直播流的时候,config配置增加 hlsOpts: {startPosition: 0} 没有生效

您期望的播放器正常行为是? What did you expect to happen? 看xgplayer-hls.js源码在注册插件的时候,使用的是 const { hlsOpts } = this.config方式获取配置,这个地方拿到的是默认配置。在我的理解上这个地方应该是使用const { hlsOpts } = this.playerConfig获取,请问是这样的吗 image

gemxx commented 2 weeks ago

hlsOpts 是插件的配置,不是xgplayer的配置

new Player({
  plugins: [HlsJsPlugin]
  HlsJsPlugin: {
    hlsOpts: {
      ...
    }
  }
})
MonsterXue commented 2 weeks ago

hlsOpts 是插件的配置,不是xgplayer的配置

new Player({
  plugins: [HlsJsPlugin]
  HlsJsPlugin: {
    hlsOpts: {
      ...
    }
  }
})

好嘞 谢谢