Docs + Pretty code

This commit is contained in:
killer069
2021-10-12 14:09:14 +05:30
parent 229bbc7a11
commit bd4afbe82a
11 changed files with 118 additions and 89 deletions

View File

@@ -23,7 +23,7 @@ export class LiveStreaming {
private segments_urls: string[];
private request: IncomingMessage | null;
constructor(dash_url: string, target_interval: number, video_url: string) {
this.stream = new Readable({ highWaterMark: 10 * 1000 * 1000, read(){} });
this.stream = new Readable({ highWaterMark: 10 * 1000 * 1000, read() {} });
this.type = StreamType.Arbitrary;
this.url = dash_url;
this.base_url = '';
@@ -102,8 +102,8 @@ export class LiveStreaming {
}
this.request = stream;
stream.on('data', (c) => {
this.stream.push(c)
})
this.stream.push(c);
});
stream.on('end', () => {
this.packet_count++;
resolve('');
@@ -143,7 +143,7 @@ export class Stream {
video_url: string,
options: StreamOptions
) {
this.stream = new Readable({ highWaterMark : 10 * 1000 * 1000, read(){} });
this.stream = new Readable({ highWaterMark: 10 * 1000 * 1000, read() {} });
this.url = url;
this.quality = options.quality as number;
this.proxy = options.proxy || undefined;
@@ -204,8 +204,8 @@ export class Stream {
}
this.request = stream;
stream.on('data', (c) => {
this.stream.push(c)
})
this.stream.push(c);
});
stream.once('error', async (err) => {
this.cleanup();