fix attach decoder

This commit is contained in:
SrGooglo 2023-08-20 03:08:40 +00:00
parent 5b6838a199
commit 0a59b1e91e

View File

@ -213,13 +213,13 @@ export default class StreamViewer extends React.Component {
}
// load the flv decoder (by default)
if (this.state.stream) {
if (!this.state.stream.sources) {
if (stream) {
if (!stream.sources) {
console.error("Stream sources not found")
return
}
await this.loadDecoder("flv", this.state.stream.sources.flv)
await this.loadDecoder("flv", stream.sources.flv)
}
// TODO: Watch ws to get livestream:started event and load the decoder if it's not loaded