Skip to content

Conversation

@appare45
Copy link

@appare45 appare45 commented Oct 9, 2024

Updated the default versions of hls.js and dash.js on readme based on props.js

react-player/src/props.js

Lines 185 to 186 in 3cda23f

hlsVersion: '1.1.4',
dashVersion: '3.1.3',

Props are used here

const { hlsVersion, hlsOptions, dashVersion, flvVersion } = this.props.config
if (this.hls) {
this.hls.destroy()
}
if (this.dash) {
this.dash.reset()
}
if (this.shouldUseHLS(url)) {
getSDK(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(Hls => {
this.hls = new Hls(hlsOptions)
this.hls.on(Hls.Events.MANIFEST_PARSED, () => {
this.props.onReady()
})
this.hls.on(Hls.Events.ERROR, (e, data) => {
this.props.onError(e, data, this.hls, Hls)
})
if (MATCH_CLOUDFLARE_STREAM.test(url)) {
const id = url.match(MATCH_CLOUDFLARE_STREAM)[1]
this.hls.loadSource(REPLACE_CLOUDFLARE_STREAM.replace('{id}', id))
} else {
this.hls.loadSource(url)
}
this.hls.attachMedia(this.player)
this.props.onLoaded()
})
}
if (this.shouldUseDASH(url)) {
getSDK(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(dashjs => {
this.dash = dashjs.MediaPlayer().create()
this.dash.initialize(this.player, url, this.props.playing)
this.dash.on('error', this.props.onError)
if (parseInt(dashVersion) < 3) {
this.dash.getDebug().setLogToBrowserConsole(false)
} else {
this.dash.updateSettings({ debug: { logLevel: dashjs.Debug.LOG_LEVEL_NONE } })
}
this.props.onLoaded()
})
}

@luwes
Copy link
Collaborator

luwes commented May 8, 2025

it's now recommended to do this with version overrides in v3
see here https://github.com/cookpete/react-player#sdk-overrides

@luwes luwes closed this May 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants