Types added for chunks
This commit is contained in:
parent
5077810dd9
commit
aabe7940fa
@ -67,7 +67,7 @@ export class LiveStreaming{
|
|||||||
await (async () => {
|
await (async () => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let stream = got.stream(this.base_url + segment)
|
let stream = got.stream(this.base_url + segment)
|
||||||
stream.on('data', (chunk) => this.stream.write(chunk))
|
stream.on('data', (chunk: any) => this.stream.write(chunk))
|
||||||
stream.on('end', () => {
|
stream.on('end', () => {
|
||||||
this.packet_count++
|
this.packet_count++
|
||||||
resolve('')
|
resolve('')
|
||||||
@ -132,7 +132,7 @@ export class LiveEnded{
|
|||||||
await (async () => {
|
await (async () => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let stream = got.stream(this.base_url + segment)
|
let stream = got.stream(this.base_url + segment)
|
||||||
stream.on('data', (chunk) => this.stream.write(chunk))
|
stream.on('data', (chunk: any) => this.stream.write(chunk))
|
||||||
stream.on('end', () => {
|
stream.on('end', () => {
|
||||||
this.packet_count++
|
this.packet_count++
|
||||||
resolve('')
|
resolve('')
|
||||||
@ -189,7 +189,7 @@ export class Stream {
|
|||||||
this.per_sec_bytes = Math.ceil((stream.downloadProgress.total as number)/this.duration)
|
this.per_sec_bytes = Math.ceil((stream.downloadProgress.total as number)/this.duration)
|
||||||
})
|
})
|
||||||
|
|
||||||
stream.on('data', (chunk) => {
|
stream.on('data', (chunk: any) => {
|
||||||
this.bytes_count += chunk.length
|
this.bytes_count += chunk.length
|
||||||
this.stream.write(chunk)
|
this.stream.write(chunk)
|
||||||
})
|
})
|
||||||
@ -217,7 +217,7 @@ export class Stream {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
stream.on('data', (chunk) => {
|
stream.on('data', (chunk: any) => {
|
||||||
absolute_bytes += chunk.length
|
absolute_bytes += chunk.length
|
||||||
this.bytes_count += chunk.length
|
this.bytes_count += chunk.length
|
||||||
this.stream.write(chunk)
|
this.stream.write(chunk)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user