Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default versions on readme #1891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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()
})
}

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.

1 participant