Live Stream interval issue fix
This commit is contained in:
parent
7d987bb5b0
commit
f7f79e68be
@ -25,7 +25,7 @@ export class LiveStreaming{
|
|||||||
this.stream = new PassThrough({ highWaterMark : 10 * 1000 * 1000 })
|
this.stream = new PassThrough({ highWaterMark : 10 * 1000 * 1000 })
|
||||||
this.segments_urls = []
|
this.segments_urls = []
|
||||||
this.packet_count = 0
|
this.packet_count = 0
|
||||||
this.interval = 0
|
this.interval = (this.format.targetDurationSec / 2) * 1000 || 0
|
||||||
this.timer = null
|
this.timer = null
|
||||||
this.stream.on('close', () => {
|
this.stream.on('close', () => {
|
||||||
this.cleanup()
|
this.cleanup()
|
||||||
@ -57,7 +57,6 @@ export class LiveStreaming{
|
|||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
this.interval = this.format.targetDurationSec
|
|
||||||
this.timer = setTimeout(async () => {
|
this.timer = setTimeout(async () => {
|
||||||
await this.looping()
|
await this.looping()
|
||||||
}, this.interval)
|
}, this.interval)
|
||||||
@ -98,6 +97,7 @@ export class LiveStreaming{
|
|||||||
|
|
||||||
private cleanup(){
|
private cleanup(){
|
||||||
clearTimeout(this.timer as NodeJS.Timer)
|
clearTimeout(this.timer as NodeJS.Timer)
|
||||||
|
this.timer = null
|
||||||
this.segments_urls = []
|
this.segments_urls = []
|
||||||
this.packet_count = 0
|
this.packet_count = 0
|
||||||
}
|
}
|
||||||
@ -125,7 +125,6 @@ export class LiveStreaming{
|
|||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
this.interval = (this.segments_urls.length / 2) * 1000
|
|
||||||
this.timer = setTimeout(async () => {
|
this.timer = setTimeout(async () => {
|
||||||
await this.start()
|
await this.start()
|
||||||
}, this.interval)
|
}, this.interval)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user