handle lirestream audio

This commit is contained in:
SrGooglo 2025-02-19 16:33:08 +00:00
parent f0c9bbef3e
commit d43d514451
2 changed files with 14 additions and 6 deletions

View File

@ -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"

View File

@ -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) {