Video Info bug fixes and stream improvements

This commit is contained in:
Atari Tom
2022-05-27 15:35:02 -04:00
parent 126c5f98d1
commit a0e3ae88c2
6 changed files with 16 additions and 12 deletions

View File

@@ -71,6 +71,7 @@ export class SeekStream {
duration: number,
headerLength: number,
contentLength: number,
bitrate: number,
video_url: string,
options: StreamOptions
) {
@@ -83,7 +84,7 @@ export class SeekStream {
this.type = StreamType.Opus;
this.bytes_count = 0;
this.video_url = video_url;
this.per_sec_bytes = Math.ceil(contentLength / duration);
this.per_sec_bytes = bitrate ? Math.ceil(bitrate / 8) : Math.ceil(contentLength / duration);
this.header_length = headerLength;
this.content_length = contentLength;
this.request = null;