m3u8stream
Advanced tools
Comparing version 0.6.3 to 0.6.4
/// <reference types="node" /> | ||
import { Writable } from 'stream'; | ||
declare const _default: { | ||
new (targetID?: string): { | ||
_parser: Writable; | ||
_write(chunk: Buffer, encoding: string, callback: () => void): void; | ||
readonly writable: boolean; | ||
readonly writableFinished: boolean; | ||
readonly writableHighWaterMark: number; | ||
readonly writableLength: number; | ||
_writev?(chunks: { | ||
chunk: any; | ||
encoding: string; | ||
}[], callback: (error?: Error) => void): void; | ||
_destroy(error: Error, callback: (error?: Error) => void): void; | ||
_final(callback: (error?: Error) => void): void; | ||
write(chunk: any, cb?: (error: Error) => void): boolean; | ||
write(chunk: any, encoding: string, cb?: (error: Error) => void): boolean; | ||
setDefaultEncoding(encoding: string): any; | ||
end(cb?: () => void): void; | ||
end(chunk: any, cb?: () => void): void; | ||
end(chunk: any, encoding: string, cb?: () => void): void; | ||
cork(): void; | ||
uncork(): void; | ||
destroy(error?: Error): void; | ||
addListener(event: "close", listener: () => void): any; | ||
addListener(event: "drain", listener: () => void): any; | ||
addListener(event: "error", listener: (err: Error) => void): any; | ||
addListener(event: "finish", listener: () => void): any; | ||
addListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
addListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
addListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
emit(event: "close"): boolean; | ||
emit(event: "drain"): boolean; | ||
emit(event: "error", err: Error): boolean; | ||
emit(event: "finish"): boolean; | ||
emit(event: "pipe", src: import("stream").Readable): boolean; | ||
emit(event: "unpipe", src: import("stream").Readable): boolean; | ||
emit(event: string | symbol, ...args: any[]): boolean; | ||
on(event: "close", listener: () => void): any; | ||
on(event: "drain", listener: () => void): any; | ||
on(event: "error", listener: (err: Error) => void): any; | ||
on(event: "finish", listener: () => void): any; | ||
on(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
on(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
on(event: string | symbol, listener: (...args: any[]) => void): any; | ||
once(event: "close", listener: () => void): any; | ||
once(event: "drain", listener: () => void): any; | ||
once(event: "error", listener: (err: Error) => void): any; | ||
once(event: "finish", listener: () => void): any; | ||
once(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
once(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
once(event: string | symbol, listener: (...args: any[]) => void): any; | ||
prependListener(event: "close", listener: () => void): any; | ||
prependListener(event: "drain", listener: () => void): any; | ||
prependListener(event: "error", listener: (err: Error) => void): any; | ||
prependListener(event: "finish", listener: () => void): any; | ||
prependListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
prependListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
prependListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
prependOnceListener(event: "close", listener: () => void): any; | ||
prependOnceListener(event: "drain", listener: () => void): any; | ||
prependOnceListener(event: "error", listener: (err: Error) => void): any; | ||
prependOnceListener(event: "finish", listener: () => void): any; | ||
prependOnceListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
prependOnceListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
removeListener(event: "close", listener: () => void): any; | ||
removeListener(event: "drain", listener: () => void): any; | ||
removeListener(event: "error", listener: (err: Error) => void): any; | ||
removeListener(event: "finish", listener: () => void): any; | ||
removeListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
removeListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
removeListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { | ||
end?: boolean; | ||
}): T; | ||
off(event: string | symbol, listener: (...args: any[]) => void): any; | ||
removeAllListeners(event?: string | symbol): any; | ||
setMaxListeners(n: number): any; | ||
getMaxListeners(): number; | ||
listeners(event: string | symbol): Function[]; | ||
rawListeners(event: string | symbol): Function[]; | ||
eventNames(): (string | symbol)[]; | ||
listenerCount(type: string | symbol): number; | ||
}; | ||
finished: typeof import("stream").finished; | ||
pipeline: typeof import("stream").pipeline; | ||
Stream: typeof import("stream").Stream; | ||
Readable: typeof import("stream").Readable; | ||
Writable: typeof Writable; | ||
Duplex: typeof import("stream").Duplex; | ||
Transform: typeof import("stream").Transform; | ||
PassThrough: typeof import("stream").PassThrough; | ||
listenerCount(emitter: import("events").EventEmitter, event: string | symbol): number; | ||
defaultMaxListeners: number; | ||
once(emitter: import("events").EventEmitter, event: string | symbol): Promise<any[]>; | ||
EventEmitter: typeof import("events").EventEmitter; | ||
}; | ||
import { Parser } from './parser'; | ||
/** | ||
* A wrapper around sax that emits segments. | ||
*/ | ||
export = _default; | ||
export default class DashMPDParser extends Writable implements Parser { | ||
private _parser; | ||
constructor(targetID?: string); | ||
_write(chunk: Buffer, encoding: string, callback: () => void): void; | ||
} |
@@ -5,6 +5,10 @@ "use strict"; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const stream_1 = require("stream"); | ||
const sax_1 = __importDefault(require("sax")); | ||
const parse_time_1 = require("./parse-time"); | ||
module.exports = class DashMPDParser extends stream_1.Writable { | ||
/** | ||
* A wrapper around sax that emits segments. | ||
*/ | ||
class DashMPDParser extends stream_1.Writable { | ||
constructor(targetID) { | ||
@@ -169,3 +173,5 @@ super(); | ||
} | ||
}; | ||
} | ||
exports.default = DashMPDParser; | ||
; | ||
//# sourceMappingURL=dash-mpd-parser.js.map |
@@ -70,3 +70,3 @@ "use strict"; | ||
let refreshTimeout; | ||
let fetchingPlaylist = false; | ||
let fetchingPlaylist = true; | ||
let ended = false; | ||
@@ -81,4 +81,5 @@ let isStatic = false; | ||
else if (!fetchingPlaylist && !ended && !isStatic && | ||
requestQueue.tasks.length + requestQueue.active === refreshThreshold) { | ||
requestQueue.tasks.length + requestQueue.active <= refreshThreshold) { | ||
let ms = Math.max(0, minRefreshTime - (Date.now() - lastRefresh)); | ||
fetchingPlaylist = true; | ||
refreshTimeout = setTimeout(refreshPlaylist, ms); | ||
@@ -95,3 +96,2 @@ } | ||
const refreshPlaylist = () => { | ||
fetchingPlaylist = true; | ||
lastRefresh = Date.now(); | ||
@@ -98,0 +98,0 @@ currPlaylist = miniget_1.default(playlistURL, requestOptions); |
/// <reference types="node" /> | ||
import { Writable } from 'stream'; | ||
declare const _default: { | ||
new (): { | ||
_lastLine: string; | ||
_seq: number; | ||
_nextItemDuration: number; | ||
_parseLine(line: string): void; | ||
_write(chunk: Buffer, encoding: string, callback: () => void): void; | ||
readonly writable: boolean; | ||
readonly writableFinished: boolean; | ||
readonly writableHighWaterMark: number; | ||
readonly writableLength: number; | ||
_writev?(chunks: { | ||
chunk: any; | ||
encoding: string; | ||
}[], callback: (error?: Error) => void): void; | ||
_destroy(error: Error, callback: (error?: Error) => void): void; | ||
_final(callback: (error?: Error) => void): void; | ||
write(chunk: any, cb?: (error: Error) => void): boolean; | ||
write(chunk: any, encoding: string, cb?: (error: Error) => void): boolean; | ||
setDefaultEncoding(encoding: string): any; | ||
end(cb?: () => void): void; | ||
end(chunk: any, cb?: () => void): void; | ||
end(chunk: any, encoding: string, cb?: () => void): void; | ||
cork(): void; | ||
uncork(): void; | ||
destroy(error?: Error): void; | ||
addListener(event: "close", listener: () => void): any; | ||
addListener(event: "drain", listener: () => void): any; | ||
addListener(event: "error", listener: (err: Error) => void): any; | ||
addListener(event: "finish", listener: () => void): any; | ||
addListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
addListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
addListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
emit(event: "close"): boolean; | ||
emit(event: "drain"): boolean; | ||
emit(event: "error", err: Error): boolean; | ||
emit(event: "finish"): boolean; | ||
emit(event: "pipe", src: import("stream").Readable): boolean; | ||
emit(event: "unpipe", src: import("stream").Readable): boolean; | ||
emit(event: string | symbol, ...args: any[]): boolean; | ||
on(event: "close", listener: () => void): any; | ||
on(event: "drain", listener: () => void): any; | ||
on(event: "error", listener: (err: Error) => void): any; | ||
on(event: "finish", listener: () => void): any; | ||
on(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
on(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
on(event: string | symbol, listener: (...args: any[]) => void): any; | ||
once(event: "close", listener: () => void): any; | ||
once(event: "drain", listener: () => void): any; | ||
once(event: "error", listener: (err: Error) => void): any; | ||
once(event: "finish", listener: () => void): any; | ||
once(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
once(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
once(event: string | symbol, listener: (...args: any[]) => void): any; | ||
prependListener(event: "close", listener: () => void): any; | ||
prependListener(event: "drain", listener: () => void): any; | ||
prependListener(event: "error", listener: (err: Error) => void): any; | ||
prependListener(event: "finish", listener: () => void): any; | ||
prependListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
prependListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
prependListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
prependOnceListener(event: "close", listener: () => void): any; | ||
prependOnceListener(event: "drain", listener: () => void): any; | ||
prependOnceListener(event: "error", listener: (err: Error) => void): any; | ||
prependOnceListener(event: "finish", listener: () => void): any; | ||
prependOnceListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
prependOnceListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
removeListener(event: "close", listener: () => void): any; | ||
removeListener(event: "drain", listener: () => void): any; | ||
removeListener(event: "error", listener: (err: Error) => void): any; | ||
removeListener(event: "finish", listener: () => void): any; | ||
removeListener(event: "pipe", listener: (src: import("stream").Readable) => void): any; | ||
removeListener(event: "unpipe", listener: (src: import("stream").Readable) => void): any; | ||
removeListener(event: string | symbol, listener: (...args: any[]) => void): any; | ||
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { | ||
end?: boolean; | ||
}): T; | ||
off(event: string | symbol, listener: (...args: any[]) => void): any; | ||
removeAllListeners(event?: string | symbol): any; | ||
setMaxListeners(n: number): any; | ||
getMaxListeners(): number; | ||
listeners(event: string | symbol): Function[]; | ||
rawListeners(event: string | symbol): Function[]; | ||
eventNames(): (string | symbol)[]; | ||
listenerCount(type: string | symbol): number; | ||
}; | ||
finished: typeof import("stream").finished; | ||
pipeline: typeof import("stream").pipeline; | ||
Stream: typeof import("stream").Stream; | ||
Readable: typeof import("stream").Readable; | ||
Writable: typeof Writable; | ||
Duplex: typeof import("stream").Duplex; | ||
Transform: typeof import("stream").Transform; | ||
PassThrough: typeof import("stream").PassThrough; | ||
listenerCount(emitter: import("events").EventEmitter, event: string | symbol): number; | ||
defaultMaxListeners: number; | ||
once(emitter: import("events").EventEmitter, event: string | symbol): Promise<any[]>; | ||
EventEmitter: typeof import("events").EventEmitter; | ||
}; | ||
import { Parser } from './parser'; | ||
/** | ||
* A very simple m3u8 playlist file parser that detects tags and segments. | ||
*/ | ||
export = _default; | ||
export default class m3u8Parser extends Writable implements Parser { | ||
private _lastLine; | ||
private _seq; | ||
private _nextItemDuration; | ||
constructor(); | ||
_parseLine(line: string): void; | ||
_write(chunk: Buffer, encoding: string, callback: () => void): void; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const stream_1 = require("stream"); | ||
module.exports = class m3u8Parser extends stream_1.Writable { | ||
/** | ||
* A very simple m3u8 playlist file parser that detects tags and segments. | ||
*/ | ||
class m3u8Parser extends stream_1.Writable { | ||
constructor() { | ||
@@ -61,3 +65,4 @@ super(); | ||
} | ||
}; | ||
} | ||
exports.default = m3u8Parser; | ||
//# sourceMappingURL=m3u8-parser.js.map |
@@ -6,25 +6,27 @@ declare type Callback = (err?: Error, result?: any) => void; | ||
} | ||
declare const _default: { | ||
new (worker: (item: any, cb: Callback) => void, options?: { | ||
export default class Queue { | ||
_worker: (item: any, cb: Callback) => void; | ||
_concurrency: number; | ||
tasks: Task[]; | ||
total: number; | ||
active: number; | ||
/** | ||
* A really simple queue with concurrency. | ||
*/ | ||
constructor(worker: (item: any, cb: Callback) => void, options?: { | ||
concurrency?: number; | ||
}): { | ||
_worker: (item: any, cb: Callback) => void; | ||
_concurrency: number; | ||
tasks: Task[]; | ||
total: number; | ||
active: number; | ||
/** | ||
* Push a task to the queue. | ||
*/ | ||
push(item: any, callback?: Callback): void; | ||
/** | ||
* Process next job in queue. | ||
*/ | ||
_next(): void; | ||
/** | ||
* Stops processing queued jobs. | ||
*/ | ||
die(): void; | ||
}; | ||
}; | ||
export = _default; | ||
}); | ||
/** | ||
* Push a task to the queue. | ||
*/ | ||
push(item: any, callback?: Callback): void; | ||
/** | ||
* Process next job in queue. | ||
*/ | ||
_next(): void; | ||
/** | ||
* Stops processing queued jobs. | ||
*/ | ||
die(): void; | ||
} | ||
export {}; |
"use strict"; | ||
module.exports = class Queue { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class Queue { | ||
/** | ||
@@ -49,3 +50,4 @@ * A really simple queue with concurrency. | ||
} | ||
}; | ||
} | ||
exports.default = Queue; | ||
//# sourceMappingURL=queue.js.map |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"repository": { | ||
@@ -36,3 +36,3 @@ "type": "git", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.7.2", | ||
"@types/node": "^13.1.0", | ||
"@types/sax": "^1.0.1", | ||
@@ -42,3 +42,3 @@ "lolex": "^5.0.0", | ||
"nock": "^11.1.0", | ||
"nyc": "^14.1.1", | ||
"nyc": "^15.0.0", | ||
"ts-node": "^8.4.1", | ||
@@ -45,0 +45,0 @@ "typescript": "^3.4.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
42870
621