We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67194ee commit 0655c9dCopy full SHA for 0655c9d
packages/xgplayer-hls.js/src/index.js
@@ -25,9 +25,23 @@ class HlsJsPlugin extends BasePlugin {
25
this.player.handleSource = false // 关闭player源处理
26
}
27
28
+ /**
29
+ * @private
30
+ */
31
+ _adaptHlsJsConfig (hlsOpts = {}) {
32
+ const { playerConfig } = this
33
+
34
+ if (!hlsOpts?.startPosition && typeof playerConfig.startTime === 'number') {
35
+ hlsOpts.startPosition = playerConfig.startTime
36
+ }
37
38
+ return hlsOpts
39
40
41
afterCreate () {
42
const { hlsOpts } = this.config
- this.hlsOpts = hlsOpts
43
+ this.hlsOpts = this._adaptHlsJsConfig(hlsOpts)
44
45
this.on(Events.URL_CHANGE, (url) => {
46
if (/^blob/.test(url)) {
47
return
0 commit comments