mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
handle lirestream audio
This commit is contained in:
parent
f0c9bbef3e
commit
d43d514451
@ -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"
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user