diff --git a/packages/app/src/cores/player/classes/TrackInstance.js b/packages/app/src/cores/player/classes/TrackInstance.js index 0ceb48b8..f88278c8 100644 --- a/packages/app/src/cores/player/classes/TrackInstance.js +++ b/packages/app/src/cores/player/classes/TrackInstance.js @@ -39,11 +39,11 @@ export default class TrackInstance { this.player.state.loading = false }, loadedmetadata: () => { - // TODO: Detect a livestream and change mode - // if (instance.media.duration === Infinity) { - // instance.manifest.stream = true - // this.state.livestream_mode = true - // } + if (this.audio.duration === Infinity) { + this.player.state.live = true + } else { + this.player.state.live = false + } }, play: () => { this.player.state.playback_status = "playing" diff --git a/packages/app/src/cores/player/player.core.js b/packages/app/src/cores/player/player.core.js index 3553f20c..3941448b 100755 --- a/packages/app/src/cores/player/player.core.js +++ b/packages/app/src/cores/player/player.core.js @@ -153,7 +153,7 @@ export default class Player extends Core { return this.queue.currentItem } - async start(manifest, { time, startIndex = 0 } = {}) { + async start(manifest, { time, startIndex = 0, radioId } = {}) { this.ui.attachPlayerComponent() if (this.queue.currentItem) { @@ -165,6 +165,14 @@ export default class Player extends Core { this.state.loading = true + if (typeof radioId === "string") { + this.state.radioId = radioId + this.state.live = true + } else { + this.state.radioId = null + this.state.live = false + } + let playlist = Array.isArray(manifest) ? manifest : [manifest] if (playlist.length === 0) {