mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added stream
proerty to instance
This commit is contained in:
parent
25100c347a
commit
62a54a0d2d
@ -33,6 +33,7 @@ class AudioPlayerStorage {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Check if source playing is a stream. Also handle if it's a stream resuming after a pause will seek to the last position
|
||||
export default class Player extends Core {
|
||||
static refName = "player"
|
||||
|
||||
@ -287,6 +288,7 @@ export default class Player extends Core {
|
||||
if (typeof manifest === "string") {
|
||||
manifest = {
|
||||
src: manifest,
|
||||
stream: false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,6 +427,13 @@ export default class Player extends Core {
|
||||
createCrossfadeInterval()
|
||||
})
|
||||
|
||||
// detect if the audio is a live stream
|
||||
instanceObj.audioElement.addEventListener("loadedmetadata", () => {
|
||||
if (instanceObj.audioElement.duration === Infinity) {
|
||||
instanceObj.manifest.stream = true
|
||||
}
|
||||
})
|
||||
|
||||
//await this.instanciateRealtimeAnalyzerNode()
|
||||
|
||||
instanceObj.track = this.audioContext.createMediaElementSource(instanceObj.audioElement)
|
||||
|
Loading…
x
Reference in New Issue
Block a user