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
|
this.player.state.loading = false
|
||||||
},
|
},
|
||||||
loadedmetadata: () => {
|
loadedmetadata: () => {
|
||||||
// TODO: Detect a livestream and change mode
|
if (this.audio.duration === Infinity) {
|
||||||
// if (instance.media.duration === Infinity) {
|
this.player.state.live = true
|
||||||
// instance.manifest.stream = true
|
} else {
|
||||||
// this.state.livestream_mode = true
|
this.player.state.live = false
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
play: () => {
|
play: () => {
|
||||||
this.player.state.playback_status = "playing"
|
this.player.state.playback_status = "playing"
|
||||||
|
@ -153,7 +153,7 @@ export default class Player extends Core {
|
|||||||
return this.queue.currentItem
|
return this.queue.currentItem
|
||||||
}
|
}
|
||||||
|
|
||||||
async start(manifest, { time, startIndex = 0 } = {}) {
|
async start(manifest, { time, startIndex = 0, radioId } = {}) {
|
||||||
this.ui.attachPlayerComponent()
|
this.ui.attachPlayerComponent()
|
||||||
|
|
||||||
if (this.queue.currentItem) {
|
if (this.queue.currentItem) {
|
||||||
@ -165,6 +165,14 @@ export default class Player extends Core {
|
|||||||
|
|
||||||
this.state.loading = true
|
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]
|
let playlist = Array.isArray(manifest) ? manifest : [manifest]
|
||||||
|
|
||||||
if (playlist.length === 0) {
|
if (playlist.length === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user