diff --git a/.eslintrc.common.cjs b/.eslintrc.common.cjs index 016d8a04..d2b1efec 100644 --- a/.eslintrc.common.cjs +++ b/.eslintrc.common.cjs @@ -1,21 +1,19 @@ module.exports = { root: true, env: { - es2021: true + es2021: true, }, extends: [ - "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", ], - plugins: ["@typescript-eslint", "prettier"], + plugins: ["@typescript-eslint"], ignorePatterns: ["/.eslintrc.cjs", "/lib", "/dist", "/vite.config.ts"], rules: { - "prettier/prettier": "error", "no-console": "warn", "@typescript-eslint/prefer-nullish-coalescing": "error", - "curly": ["warn", "multi-line", "consistent"], - "spaced-comment": ["warn", "always", {"markers": ["/"]}], - "no-debugger": "warn" - } + curly: ["warn", "multi-line", "consistent"], + "spaced-comment": ["warn", "always", { markers: ["/"] }], + "no-debugger": "warn", + }, }; diff --git a/.prettierrc.common.cjs b/.prettierrc.common.cjs index 799fa991..ddf1efd3 100644 --- a/.prettierrc.common.cjs +++ b/.prettierrc.common.cjs @@ -1,5 +1,3 @@ module.exports = { editorconfig: true, - singleQuote: false, - trailingComma: "es5" }; diff --git a/package.json b/package.json index 3f234c04..e47ab33a 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@typescript-eslint/eslint-plugin": "^6.18.1", "@typescript-eslint/parser": "^6.18.1", "eslint": "^8.56.0", - "eslint-plugin-prettier": "^5.1.3", "prettier": "^3.1.1", "rimraf": "^5.0.5", "typescript": "^5.3.3", diff --git a/packages/p2p-media-loader-core/src/bandwidth-calculator.ts b/packages/p2p-media-loader-core/src/bandwidth-calculator.ts index c8cc5e54..a4c07e52 100644 --- a/packages/p2p-media-loader-core/src/bandwidth-calculator.ts +++ b/packages/p2p-media-loader-core/src/bandwidth-calculator.ts @@ -32,7 +32,7 @@ export class BandwidthCalculator { getBandwidthLoadingOnly( seconds: number, - ignoreThresholdTimestamp = Number.NEGATIVE_INFINITY + ignoreThresholdTimestamp = Number.NEGATIVE_INFINITY, ) { if (!this.loadingOnlyTimestamps.length) return 0; const milliseconds = seconds * 1000; @@ -60,7 +60,7 @@ export class BandwidthCalculator { getBandwidth( seconds: number, ignoreThresholdTimestamp = Number.NEGATIVE_INFINITY, - now = performance.now() + now = performance.now(), ) { if (!this.timestamps.length) return 0; const milliseconds = seconds * 1000; diff --git a/packages/p2p-media-loader-core/src/core.ts b/packages/p2p-media-loader-core/src/core.ts index ee233c93..e98289ab 100644 --- a/packages/p2p-media-loader-core/src/core.ts +++ b/packages/p2p-media-loader-core/src/core.ts @@ -53,7 +53,7 @@ export class Core { hasSegment(segmentLocalId: string): boolean { const segment = StreamUtils.getSegmentFromStreamsMap( this.streams, - segmentLocalId + segmentLocalId, ); return !!segment; } @@ -73,7 +73,7 @@ export class Core { updateStream( streamLocalId: string, addSegments?: SegmentBase[], - removeSegmentIds?: string[] + removeSegmentIds?: string[], ): void { const stream = this.streams.get(streamLocalId); if (!stream) return; @@ -94,7 +94,7 @@ export class Core { if (!this.segmentStorage) { this.segmentStorage = new SegmentsMemoryStorage( this.manifestResponseUrl, - this.settings + this.settings, ); await this.segmentStorage.initialize(); } @@ -144,7 +144,7 @@ export class Core { const segment = StreamUtils.getSegmentFromStreamsMap( this.streams, - segmentId + segmentId, ); if (!segment) { throw new Error(`Not found segment with id: ${segmentId}`); @@ -168,7 +168,7 @@ export class Core { this.settings, this.bandwidthCalculators, this.segmentStorage, - this.eventHandlers + this.eventHandlers, ); }; const streamTypeLoaderKeyMap = { diff --git a/packages/p2p-media-loader-core/src/declarations.d.ts b/packages/p2p-media-loader-core/src/declarations.d.ts index 003539ea..44e432b9 100644 --- a/packages/p2p-media-loader-core/src/declarations.d.ts +++ b/packages/p2p-media-loader-core/src/declarations.d.ts @@ -11,7 +11,7 @@ declare module "bittorrent-tracker" { on( event: E, - handler: TrackerClientEvents[E] + handler: TrackerClientEvents[E], ): void; start(): void; diff --git a/packages/p2p-media-loader-core/src/http-loader.ts b/packages/p2p-media-loader-core/src/http-loader.ts index 59980b9a..3aaf54ea 100644 --- a/packages/p2p-media-loader-core/src/http-loader.ts +++ b/packages/p2p-media-loader-core/src/http-loader.ts @@ -17,7 +17,7 @@ export class HttpRequestExecutor { constructor( private readonly request: Request, - private readonly settings: HttpSettings + private readonly settings: HttpSettings, ) { const { byteRange } = this.request.segment; if (byteRange) this.byteRange = { ...byteRange }; @@ -42,7 +42,7 @@ export class HttpRequestExecutor { { abort: () => this.abortController.abort("abort"), notReceivingBytesTimeoutMs: httpNotReceivingBytesTimeoutMs, - } + }, ); void this.fetch(); } @@ -92,7 +92,7 @@ export class HttpRequestExecutor { if (response.status !== 206) { throw new RequestError( "http-unexpected-status-code", - response.statusText + response.statusText, ); } const contentLengthHeader = response.headers.get("Content-Length"); @@ -146,7 +146,7 @@ export class HttpRequestExecutor { } async function* readStream( - reader: ReadableStreamDefaultReader + reader: ReadableStreamDefaultReader, ): AsyncGenerator { while (true) { const { done, value } = await reader.read(); diff --git a/packages/p2p-media-loader-core/src/hybrid-loader.ts b/packages/p2p-media-loader-core/src/hybrid-loader.ts index bd896af7..7d17d24a 100644 --- a/packages/p2p-media-loader-core/src/hybrid-loader.ts +++ b/packages/p2p-media-loader-core/src/hybrid-loader.ts @@ -40,7 +40,7 @@ export class HybridLoader { private readonly settings: Settings, private readonly bandwidthCalculators: BandwidthCalculators, private readonly segmentStorage: SegmentsMemoryStorage, - private readonly eventHandlers?: Pick + private readonly eventHandlers?: Pick, ) { const activeStream = this.lastRequestedSegment.stream; this.playback = { position: this.lastRequestedSegment.startTime, rate: 1 }; @@ -49,7 +49,7 @@ export class HybridLoader { this.requestProcessQueueMicrotask, this.bandwidthCalculators, this.playback, - this.settings + this.settings, ); if (!this.segmentStorage.isInitialized) { @@ -60,7 +60,7 @@ export class HybridLoader { return StreamUtils.isSegmentActualInPlayback( segment, this.playback, - this.settings + this.settings, ); }); this.p2pLoaders = new P2PLoadersContainer( @@ -68,7 +68,7 @@ export class HybridLoader { this.lastRequestedSegment.stream, this.requests, this.segmentStorage, - this.settings + this.settings, ); this.logger = debug(`core:hybrid-loader-${activeStream.type}`); @@ -102,7 +102,7 @@ export class HybridLoader { if (data) { engineRequest.resolve( data, - this.bandwidthCalculators.all.getBandwidthLoadingOnly(3) + this.bandwidthCalculators.all.getBandwidthLoadingOnly(3), ); } } else { @@ -135,7 +135,7 @@ export class HybridLoader { private processRequests( queueSegmentIds: Set, - queueDownloadRatio: number + queueDownloadRatio: number, ) { const { stream } = this.lastRequestedSegment; const { httpErrorRetries } = this.settings; @@ -163,7 +163,7 @@ export class HybridLoader { if (engineRequest) { engineRequest.resolve( request.data, - this.getBandwidth(queueDownloadRatio) + this.getBandwidth(queueDownloadRatio), ); this.engineRequest = undefined; } @@ -308,7 +308,7 @@ export class HybridLoader { this.engineRequest.abort(); this.logger( "abort: ", - LoggerUtils.getSegmentString(this.engineRequest.segment) + LoggerUtils.getSegmentString(this.engineRequest.segment), ); this.engineRequest = undefined; } @@ -339,7 +339,7 @@ export class HybridLoader { for (const { segment, statuses } of QueueUtils.generateQueue( this.lastRequestedSegment, this.playback, - this.settings + this.settings, )) { if ( !statuses.isHttpDownloadable || @@ -372,7 +372,7 @@ export class HybridLoader { private abortLastHttpLoadingInQueueAfterItem( queue: QueueUtils.QueueItem[], - segment: Segment + segment: Segment, ): boolean { for (const { segment: itemSegment } of Utils.arrayBackwards(queue)) { if (itemSegment === segment) break; @@ -387,7 +387,7 @@ export class HybridLoader { private abortLastP2PLoadingInQueueAfterItem( queue: QueueUtils.QueueItem[], - segment: Segment + segment: Segment, ): boolean { for (const { segment: itemSegment } of Utils.arrayBackwards(queue)) { if (itemSegment === segment) break; @@ -408,7 +408,7 @@ export class HybridLoader { for (const item of QueueUtils.generateQueue( this.lastRequestedSegment, this.playback, - this.settings + this.settings, )) { maxPossibleLength++; const { segment } = item; @@ -444,19 +444,19 @@ export class HybridLoader { const bandwidth = Math.max( all.getBandwidth(30, levelChangedTimestamp), all.getBandwidth(60, levelChangedTimestamp), - all.getBandwidth(90, levelChangedTimestamp) + all.getBandwidth(90, levelChangedTimestamp), ); if (queueDownloadRatio >= 0.8 || bandwidth >= activeLevelBitrate * 0.9) { return Math.max( all.getBandwidthLoadingOnly(1), all.getBandwidthLoadingOnly(3), - all.getBandwidthLoadingOnly(5) + all.getBandwidthLoadingOnly(5), ); } const httpRealBandwidth = Math.max( http.getBandwidthLoadingOnly(1), http.getBandwidthLoadingOnly(3), - http.getBandwidthLoadingOnly(5) + http.getBandwidthLoadingOnly(5), ); return Math.max(bandwidth, httpRealBandwidth); } diff --git a/packages/p2p-media-loader-core/src/p2p/commands/binary-command-creator.ts b/packages/p2p-media-loader-core/src/p2p/commands/binary-command-creator.ts index 4da5e551..e0755dfd 100644 --- a/packages/p2p-media-loader-core/src/p2p/commands/binary-command-creator.ts +++ b/packages/p2p-media-loader-core/src/p2p/commands/binary-command-creator.ts @@ -15,10 +15,10 @@ export function isCommandChunk(buffer: Uint8Array) { const bufferEndingToCompare = buffer.slice(-length); return ( startFrames.some((frame) => - areBuffersEqual(buffer, frame, FRAME_PART_LENGTH) + areBuffersEqual(buffer, frame, FRAME_PART_LENGTH), ) && endFrames.some((frame) => - areBuffersEqual(bufferEndingToCompare, frame, FRAME_PART_LENGTH) + areBuffersEqual(bufferEndingToCompare, frame, FRAME_PART_LENGTH), ) ); } @@ -31,7 +31,7 @@ function isLastCommandChunk(buffer: Uint8Array) { return areBuffersEqual( buffer.slice(-FRAME_PART_LENGTH), commandFrameEnd, - FRAME_PART_LENGTH + FRAME_PART_LENGTH, ); } @@ -46,7 +46,7 @@ export class BinaryCommandChunksJoiner { private status: "joining" | "completed" = "joining"; constructor( - private readonly onComplete: (commandBuffer: Uint8Array) => void + private readonly onComplete: (commandBuffer: Uint8Array) => void, ) {} addCommandChunk(chunk: Uint8Array) { @@ -78,7 +78,7 @@ export class BinaryCommandCreator { constructor( commandType: PeerCommandType, - private readonly maxChunkLength: number + private readonly maxChunkLength: number, ) { this.bytes.push(commandType); } @@ -92,7 +92,7 @@ export class BinaryCommandCreator { addSimilarIntArr(name: string, arr: number[]) { this.bytes.push(name.charCodeAt(0)); const bytes = Serialization.serializeSimilarIntArray( - arr.map((num) => BigInt(num)) + arr.map((num) => BigInt(num)), ); this.bytes.push(bytes); } @@ -111,7 +111,7 @@ export class BinaryCommandCreator { const unframedBuffer = this.bytes.getBuffer(); if (unframedBuffer.length + commandFramesLength <= this.maxChunkLength) { this.resultBuffers.push( - frameBuffer(unframedBuffer, commandFrameStart, commandFrameEnd) + frameBuffer(unframedBuffer, commandFrameStart, commandFrameEnd), ); return; } @@ -126,19 +126,19 @@ export class BinaryCommandCreator { for (const [i, chunk] of splitBufferToEqualChunks( unframedBuffer, - chunksAmount + chunksAmount, )) { if (i === 0) { this.resultBuffers.push( - frameBuffer(chunk, commandFrameStart, commandDivFrameEnd) + frameBuffer(chunk, commandFrameStart, commandDivFrameEnd), ); } else if (i === chunksAmount - 1) { this.resultBuffers.push( - frameBuffer(chunk, commandDivFrameStart, commandFrameEnd) + frameBuffer(chunk, commandDivFrameStart, commandFrameEnd), ); } else { this.resultBuffers.push( - frameBuffer(chunk, commandDivFrameStart, commandDivFrameEnd) + frameBuffer(chunk, commandDivFrameStart, commandDivFrameEnd), ); } } @@ -169,7 +169,7 @@ export function deserializeCommand(bytes: Uint8Array): PeerCommand { case Serialization.SerializedItem.Int: { const { number, byteLength } = Serialization.deserializeInt( - bytes.slice(offset) + bytes.slice(offset), ); deserializedCommand[name] = Number(number); offset += byteLength; @@ -186,7 +186,7 @@ export function deserializeCommand(bytes: Uint8Array): PeerCommand { case Serialization.SerializedItem.String: { const { string, byteLength } = Serialization.deserializeString( - bytes.slice(offset) + bytes.slice(offset), ); deserializedCommand[name] = string; offset += byteLength; @@ -217,7 +217,7 @@ function stringToUtf8CodesBuffer(string: string, length?: number): Uint8Array { function* splitBufferToEqualChunks( buffer: Uint8Array, - chunksAmount: number + chunksAmount: number, ): Generator<[number, Uint8Array], void> { const chunkLength = Math.ceil(buffer.length / chunksAmount); for (let i = 0; i < chunksAmount; i++) { @@ -228,10 +228,10 @@ function* splitBufferToEqualChunks( function frameBuffer( buffer: Uint8Array, frameStart: Uint8Array, - frameEnd: Uint8Array + frameEnd: Uint8Array, ) { const result = new Uint8Array( - buffer.length + frameStart.length + frameEnd.length + buffer.length + frameStart.length + frameEnd.length, ); result.set(frameStart); result.set(buffer, frameStart.length); @@ -243,7 +243,7 @@ function frameBuffer( function areBuffersEqual( buffer1: Uint8Array, buffer2: Uint8Array, - length: number + length: number, ) { for (let i = 0; i < length; i++) { if (buffer1[i] !== buffer2[i]) return false; diff --git a/packages/p2p-media-loader-core/src/p2p/commands/binary-serialization.ts b/packages/p2p-media-loader-core/src/p2p/commands/binary-serialization.ts index 794afd1b..89c79b45 100644 --- a/packages/p2p-media-loader-core/src/p2p/commands/binary-serialization.ts +++ b/packages/p2p-media-loader-core/src/p2p/commands/binary-serialization.ts @@ -64,7 +64,7 @@ export function deserializeInt(bytes: Uint8Array) { const code = metadata >> 4; if (code !== SerializedItem.Int) { throw new Error( - "Trying to deserialize integer with invalid serialized item code" + "Trying to deserialize integer with invalid serialized item code", ); } const numberBytesLength = metadata & 0b1111; @@ -105,7 +105,7 @@ export function deserializeSimilarIntArray(bytes: Uint8Array) { const code = codeByte >> 4; if (code !== SerializedItem.SimilarIntArray) { throw new Error( - "Trying to deserialize similar int array with invalid serialized item code" + "Trying to deserialize similar int array with invalid serialized item code", ); } @@ -113,7 +113,7 @@ export function deserializeSimilarIntArray(bytes: Uint8Array) { const originalIntArr: bigint[] = []; for (let i = 0; i < commonPartArraysAmount; i++) { const { number: commonPartWithLength, byteLength } = deserializeInt( - bytes.slice(offset) + bytes.slice(offset), ); offset += byteLength; const arrayLength = commonPartWithLength & 0xffn; @@ -145,7 +145,7 @@ export function deserializeString(bytes: Uint8Array) { const code = codeByte >> 4; if (code !== SerializedItem.String) { throw new Error( - "Trying to deserialize bytes (sting) with invalid serialized item code." + "Trying to deserialize bytes (sting) with invalid serialized item code.", ); } const length = ((codeByte & 0x0f) << 8) | lengthByte; @@ -168,7 +168,7 @@ export class ResizableUint8Array { private addBytes( bytes: Uint8Array | number | number[], - position: "start" | "end" + position: "start" | "end", ) { let bytesToAdd: Uint8Array; if (bytes instanceof Uint8Array) { diff --git a/packages/p2p-media-loader-core/src/p2p/commands/commands.ts b/packages/p2p-media-loader-core/src/p2p/commands/commands.ts index d5cdd6f9..98896114 100644 --- a/packages/p2p-media-loader-core/src/p2p/commands/commands.ts +++ b/packages/p2p-media-loader-core/src/p2p/commands/commands.ts @@ -10,7 +10,7 @@ import { function serializeSegmentAnnouncementCommand( command: PeerSegmentAnnouncementCommand, - maxChunkSize: number + maxChunkSize: number, ) { const { c: commandCode, p: loadingByHttp, l: loaded } = command; const creator = new BinaryCommandCreator(commandCode, maxChunkSize); @@ -24,7 +24,7 @@ function serializeSegmentAnnouncementCommand( function serializePeerSegmentCommand( command: PeerSegmentCommand, - maxChunkSize: number + maxChunkSize: number, ) { const creator = new BinaryCommandCreator(command.c, maxChunkSize); creator.addInteger("i", command.i); @@ -34,7 +34,7 @@ function serializePeerSegmentCommand( function serializePeerSendSegmentCommand( command: PeerSendSegmentCommand, - maxChunkSize: number + maxChunkSize: number, ) { const creator = new BinaryCommandCreator(command.c, maxChunkSize); creator.addInteger("i", command.i); @@ -45,7 +45,7 @@ function serializePeerSendSegmentCommand( function serializePeerSegmentRequestCommand( command: PeerRequestSegmentCommand, - maxChunkSize: number + maxChunkSize: number, ) { const creator = new BinaryCommandCreator(command.c, maxChunkSize); creator.addInteger("i", command.i); @@ -56,7 +56,7 @@ function serializePeerSegmentRequestCommand( export function serializePeerCommand( command: PeerCommand, - maxChunkSize: number + maxChunkSize: number, ) { switch (command.c) { case PeerCommandType.CancelSegmentRequest: diff --git a/packages/p2p-media-loader-core/src/p2p/loader.ts b/packages/p2p-media-loader-core/src/p2p/loader.ts index 92c9ab84..12e92d54 100644 --- a/packages/p2p-media-loader-core/src/p2p/loader.ts +++ b/packages/p2p-media-loader-core/src/p2p/loader.ts @@ -16,11 +16,11 @@ export class P2PLoader { private readonly stream: StreamWithSegments, private readonly requests: RequestsContainer, private readonly segmentStorage: SegmentsMemoryStorage, - private readonly settings: Settings + private readonly settings: Settings, ) { const streamExternalId = StreamUtils.getStreamExternalId( this.streamManifestUrl, - this.stream + this.stream, ); this.trackerClient = new P2PTrackerClient( @@ -30,12 +30,12 @@ export class P2PLoader { onPeerConnected: this.onPeerConnected, onSegmentRequested: this.onSegmentRequested, }, - this.settings + this.settings, ); this.segmentStorage.subscribeOnUpdate( this.stream, - this.broadcastAnnouncement + this.broadcastAnnouncement, ); this.trackerClient.start(); } @@ -114,11 +114,11 @@ export class P2PLoader { private onSegmentRequested = async ( peer: Peer, segmentExternalId: number, - byteFrom?: number + byteFrom?: number, ) => { const segment = StreamUtils.getSegmentFromStreamByExternalId( this.stream, - segmentExternalId + segmentExternalId, ); if (!segment) return; const segmentData = await this.segmentStorage.getSegmentData(segment); @@ -128,14 +128,14 @@ export class P2PLoader { } void peer.uploadSegmentData( segment, - byteFrom !== undefined ? segmentData.slice(byteFrom) : segmentData + byteFrom !== undefined ? segmentData.slice(byteFrom) : segmentData, ); }; destroy() { this.segmentStorage.unsubscribeFromUpdate( this.stream, - this.broadcastAnnouncement + this.broadcastAnnouncement, ); this.trackerClient.destroy(); } diff --git a/packages/p2p-media-loader-core/src/p2p/loaders-container.ts b/packages/p2p-media-loader-core/src/p2p/loaders-container.ts index 34b02415..a32832b8 100644 --- a/packages/p2p-media-loader-core/src/p2p/loaders-container.ts +++ b/packages/p2p-media-loader-core/src/p2p/loaders-container.ts @@ -22,7 +22,7 @@ export class P2PLoadersContainer { stream: StreamWithSegments, private readonly requests: RequestsContainer, private readonly segmentStorage: SegmentsMemoryStorage, - private readonly settings: Settings + private readonly settings: Settings, ) { this.changeCurrentLoader(stream); } @@ -36,7 +36,7 @@ export class P2PLoadersContainer { stream, this.requests, this.segmentStorage, - this.settings + this.settings, ); const loggerInfo = LoggerUtils.getStreamString(stream); this.logger(`created new loader: ${loggerInfo}`); @@ -51,7 +51,7 @@ export class P2PLoadersContainer { const loaderItem = this.loaders.get(stream.localId); if (this._currentLoaderItem) { const ids = this.segmentStorage.getStoredSegmentExternalIdsOfStream( - this._currentLoaderItem.stream + this._currentLoaderItem.stream, ); if (!ids.length) this.destroyAndRemoveLoader(this._currentLoaderItem); else this.setLoaderDestroyTimeout(this._currentLoaderItem); @@ -66,14 +66,14 @@ export class P2PLoadersContainer { this._currentLoaderItem = loader; } this.logger( - `change current p2p loader: ${LoggerUtils.getStreamString(stream)}` + `change current p2p loader: ${LoggerUtils.getStreamString(stream)}`, ); } private setLoaderDestroyTimeout(item: P2PLoaderContainerItem) { item.destroyTimeoutId = window.setTimeout( () => this.destroyAndRemoveLoader(item), - this.settings.p2pLoaderDestroyTimeoutMs + this.settings.p2pLoaderDestroyTimeoutMs, ); } diff --git a/packages/p2p-media-loader-core/src/p2p/peer-protocol.ts b/packages/p2p-media-loader-core/src/p2p/peer-protocol.ts index eda3b608..15d9674a 100644 --- a/packages/p2p-media-loader-core/src/p2p/peer-protocol.ts +++ b/packages/p2p-media-loader-core/src/p2p/peer-protocol.ts @@ -19,7 +19,7 @@ export class PeerProtocol { onCommandReceived: (command: Command.PeerCommand) => void; onSegmentChunkReceived: (data: Uint8Array) => void; onDestroy: () => void; - } + }, ) { connection.on("data", this.onDataReceived); connection.on("close", this.onPeerClosed); @@ -49,7 +49,7 @@ export class PeerProtocol { sendCommand(command: Command.PeerCommand) { const binaryCommandBuffers = Command.serializePeerCommand( command, - this.settings.webRtcMaxMessageSize + this.settings.webRtcMaxMessageSize, ); for (const buffer of binaryCommandBuffers) { this.connection.send(buffer); @@ -109,7 +109,7 @@ export class PeerProtocol { this.commandChunks = undefined; const command = Command.deserializeCommand(commandBuffer); this.eventHandlers.onCommandReceived(command); - } + }, ); } try { @@ -127,7 +127,7 @@ export class PeerProtocol { function* getBufferChunks( data: ArrayBuffer, - maxChunkSize: number + maxChunkSize: number, ): Generator { let bytesLeft = data.byteLength; while (bytesLeft > 0) { diff --git a/packages/p2p-media-loader-core/src/p2p/peer.ts b/packages/p2p-media-loader-core/src/p2p/peer.ts index fac4c767..7548bd8c 100644 --- a/packages/p2p-media-loader-core/src/p2p/peer.ts +++ b/packages/p2p-media-loader-core/src/p2p/peer.ts @@ -18,7 +18,7 @@ type PeerEventHandlers = { onSegmentRequested: ( peer: Peer, segmentId: number, - byteFrom?: number + byteFrom?: number, ) => void; }; @@ -40,7 +40,7 @@ export class Peer { constructor( connection: PeerConnection, private readonly eventHandlers: PeerEventHandlers, - private readonly settings: PeerSettings + private readonly settings: PeerSettings, ) { this.id = Peer.getPeerIdFromConnection(connection); this.peerProtocol = new PeerProtocol(connection, settings, { @@ -149,14 +149,14 @@ export class Peer { this.downloadingErrors.push(error); const timeoutErrors = this.downloadingErrors.filter( - (error) => error.type === "bytes-receiving-timeout" + (error) => error.type === "bytes-receiving-timeout", ); const { p2pErrorRetries } = this.settings; if (timeoutErrors.length >= p2pErrorRetries) { this.peerProtocol.destroy(); } }, - } + }, ), }; const command: Command.PeerRequestSegmentCommand = { @@ -178,7 +178,7 @@ export class Peer { this.peerProtocol.sendCommand(command); try { await this.peerProtocol.splitSegmentDataToChunksAndUploadAsync( - data as Uint8Array + data as Uint8Array, ); this.sendSegmentDataSendingCompletedCommand(segment); this.logger(`segment ${externalId} has been sent to ${this.id}`); @@ -203,7 +203,7 @@ export class Peer { sendSegmentsAnnouncementCommand( loadedSegmentsIds: number[], - httpLoadingSegmentsIds: number[] + httpLoadingSegmentsIds: number[], ) { const command: Command.PeerSegmentAnnouncementCommand = { c: PeerCommandType.SegmentsAnnouncement, diff --git a/packages/p2p-media-loader-core/src/p2p/tracker-client.ts b/packages/p2p-media-loader-core/src/p2p/tracker-client.ts index 9f42dc48..da89d6e9 100644 --- a/packages/p2p-media-loader-core/src/p2p/tracker-client.ts +++ b/packages/p2p-media-loader-core/src/p2p/tracker-client.ts @@ -28,7 +28,7 @@ export class P2PTrackerClient { streamId: string, stream: StreamWithSegments, private readonly eventHandlers: P2PTrackerClientEventHandlers, - private readonly settings: Settings + private readonly settings: Settings, ) { const { string: peerId, bytes: peerIdBytes } = PeerUtil.generatePeerId(); const { bytes: streamIdBytes, string: streamHash } = @@ -57,7 +57,7 @@ export class P2PTrackerClient { this.client.on("warning", this.onTrackerClientWarning); this.client.on("error", this.onTrackerClientError); this.logger( - `create new client; \nstream: ${this.streamShortId}; hash: ${streamHash}; \npeer id: ${this.peerId}` + `create new client; \nstream: ${this.streamShortId}; hash: ${streamHash}; \npeer id: ${this.peerId}`, ); } @@ -78,7 +78,7 @@ export class P2PTrackerClient { } private onReceivePeerConnection: TrackerClientEvents["peer"] = ( - peerConnection + peerConnection, ) => { const itemId = Peer.getPeerIdFromConnection(peerConnection); let peerItem = this._peers.get(itemId); @@ -104,17 +104,17 @@ export class P2PTrackerClient { onPeerClosed: this.onPeerClosed, onSegmentRequested: this.eventHandlers.onSegmentRequested, }, - this.settings + this.settings, ); this.logger( - `connected with peer: ${peerItem.peer.id} ${this.streamShortId}` + `connected with peer: ${peerItem.peer.id} ${this.streamShortId}`, ); this.eventHandlers.onPeerConnected(peerItem.peer); }); }; private onTrackerClientWarning: TrackerClientEvents["warning"] = ( - warning + warning, ) => { this.logger(`tracker warning (${this.streamShortId}: ${warning})`); }; diff --git a/packages/p2p-media-loader-core/src/requests/engine-request.ts b/packages/p2p-media-loader-core/src/requests/engine-request.ts index ba269dc4..40ab5d7e 100644 --- a/packages/p2p-media-loader-core/src/requests/engine-request.ts +++ b/packages/p2p-media-loader-core/src/requests/engine-request.ts @@ -11,7 +11,7 @@ export class EngineRequest { constructor( readonly segment: Segment, - readonly engineCallbacks: EngineCallbacks + readonly engineCallbacks: EngineCallbacks, ) {} get status() { diff --git a/packages/p2p-media-loader-core/src/requests/request-container.ts b/packages/p2p-media-loader-core/src/requests/request-container.ts index 8168c865..7da11862 100644 --- a/packages/p2p-media-loader-core/src/requests/request-container.ts +++ b/packages/p2p-media-loader-core/src/requests/request-container.ts @@ -8,7 +8,7 @@ export class RequestsContainer { private readonly requestProcessQueueCallback: () => void, private readonly bandwidthCalculators: BandwidthCalculators, private readonly playback: Playback, - private readonly settings: Settings + private readonly settings: Settings, ) {} get executingHttpCount() { @@ -39,7 +39,7 @@ export class RequestsContainer { this.requestProcessQueueCallback, this.bandwidthCalculators, this.playback, - this.settings + this.settings, ); this.requests.set(segment, request); } diff --git a/packages/p2p-media-loader-core/src/requests/request.ts b/packages/p2p-media-loader-core/src/requests/request.ts index a8a22a17..538ff15e 100644 --- a/packages/p2p-media-loader-core/src/requests/request.ts +++ b/packages/p2p-media-loader-core/src/requests/request.ts @@ -58,7 +58,7 @@ export class Request { private progress?: LoadProgress; private notReceivingBytesTimeout: Timeout; private _abortRequestCallback?: ( - error: RequestError + error: RequestError, ) => void; private readonly _logger: debug.Debugger; private _isHandledByProcessQueue = false; @@ -68,7 +68,7 @@ export class Request { private readonly requestProcessQueueCallback: () => void, private readonly bandwidthCalculators: BandwidthCalculators, private readonly playback: Playback, - private readonly settings: StreamUtils.PlaybackTimeWindowsSettings + private readonly settings: StreamUtils.PlaybackTimeWindowsSettings, ) { this.id = Request.getRequestItemId(this.segment); const { byteRange } = this.segment; @@ -139,16 +139,16 @@ export class Request { controls: { notReceivingBytesTimeoutMs?: number; abort: (errorType: RequestError) => void; - } + }, ): RequestControls { if (this._status === "succeed") { throw new Error( - `Request ${this.segment.externalId} has been already succeed.` + `Request ${this.segment.externalId} has been already succeed.`, ); } if (this._status === "loading") { throw new Error( - `Request ${this.segment.externalId} has been already started.` + `Request ${this.segment.externalId} has been already started.`, ); } @@ -171,11 +171,11 @@ export class Request { const statuses = StreamUtils.getSegmentPlaybackStatuses( this.segment, this.playback, - this.settings + this.settings, ); const statusString = LoggerUtils.getSegmentPlaybackStatusesString(statuses); this.logger( - `${requestData.type} ${this.segment.externalId} ${statusString} started` + `${requestData.type} ${this.segment.externalId} ${statusString} started`, ); return { @@ -190,7 +190,7 @@ export class Request { this.throwErrorIfNotLoadingStatus(); this.setStatus("aborted"); this.logger( - `${this.currentAttempt?.type} ${this.segment.externalId} aborted` + `${this.currentAttempt?.type} ${this.segment.externalId} aborted`, ); this._abortRequestCallback?.(new RequestError("abort")); this._abortRequestCallback = undefined; @@ -242,7 +242,7 @@ export class Request { this._totalBytes = this._loadedBytes; this.logger( - `${this.currentAttempt.type} ${this.segment.externalId} succeed` + `${this.currentAttempt.type} ${this.segment.externalId} succeed`, ); this.requestProcessQueueCallback(); }; @@ -302,7 +302,7 @@ class FailedRequestAttempts { get httpAttemptsCount() { return this.attempts.reduce( (sum, attempt) => (attempt.type === "http" ? sum + 1 : sum), - 0 + 0, ); } @@ -345,7 +345,7 @@ export class RequestError< constructor( readonly type: T, - message?: string + message?: string, ) { super(message); this.timestamp = performance.now(); diff --git a/packages/p2p-media-loader-core/src/segments-storage.ts b/packages/p2p-media-loader-core/src/segments-storage.ts index bd8577fb..99ed4338 100644 --- a/packages/p2p-media-loader-core/src/segments-storage.ts +++ b/packages/p2p-media-loader-core/src/segments-storage.ts @@ -27,14 +27,14 @@ export class SegmentsMemoryStorage { private cache = new Map(); private _isInitialized = false; private readonly isSegmentLockedPredicates: (( - segment: Segment + segment: Segment, ) => boolean)[] = []; private readonly logger: Debug.Debugger; private readonly events = new EventDispatcher(); constructor( private readonly masterManifestUrl: string, - private readonly settings: StorageSettings + private readonly settings: StorageSettings, ) { this.logger = Debug("core:segment-memory-storage"); this.logger.color = "RebeccaPurple"; @@ -143,7 +143,7 @@ export class SegmentsMemoryStorage { subscribeOnUpdate( stream: Stream, - listener: StorageEventHandlers["onStorageUpdated"] + listener: StorageEventHandlers["onStorageUpdated"], ) { const localId = StreamUtils.getStreamShortId(stream); this.events.subscribe(`onStorageUpdated-${localId}`, listener); @@ -151,7 +151,7 @@ export class SegmentsMemoryStorage { unsubscribeFromUpdate( stream: Stream, - listener: StorageEventHandlers["onStorageUpdated"] + listener: StorageEventHandlers["onStorageUpdated"], ) { const localId = StreamUtils.getStreamShortId(stream); this.events.unsubscribe(`onStorageUpdated-${localId}`, listener); @@ -160,7 +160,7 @@ export class SegmentsMemoryStorage { private dispatchStorageUpdatedEvent(stream: Stream) { this.events.dispatch( `onStorageUpdated${StreamUtils.getStreamShortId(stream)}`, - stream + stream, ); } diff --git a/packages/p2p-media-loader-core/src/utils/logger.ts b/packages/p2p-media-loader-core/src/utils/logger.ts index b4a290db..81ef7fe9 100644 --- a/packages/p2p-media-loader-core/src/utils/logger.ts +++ b/packages/p2p-media-loader-core/src/utils/logger.ts @@ -11,7 +11,7 @@ export function getSegmentString(segment: Segment) { } export function getSegmentPlaybackStatusesString( - statuses: SegmentPlaybackStatuses + statuses: SegmentPlaybackStatuses, ): string { const { isHighDemand, isHttpDownloadable, isP2PDownloadable } = statuses; if (isHighDemand) return "high-demand"; diff --git a/packages/p2p-media-loader-core/src/utils/peer.ts b/packages/p2p-media-loader-core/src/utils/peer.ts index 9501231a..cf1e2b97 100644 --- a/packages/p2p-media-loader-core/src/utils/peer.ts +++ b/packages/p2p-media-loader-core/src/utils/peer.ts @@ -26,7 +26,7 @@ export function generatePeerId(): { for (let i = 0; i < randomCharsAmount; i++) { peerId += HASH_SYMBOLS.charAt( - Math.floor(Math.random() * HASH_SYMBOLS.length) + Math.floor(Math.random() * HASH_SYMBOLS.length), ); } diff --git a/packages/p2p-media-loader-core/src/utils/queue.ts b/packages/p2p-media-loader-core/src/utils/queue.ts index e8e7cc3d..cdf249c5 100644 --- a/packages/p2p-media-loader-core/src/utils/queue.ts +++ b/packages/p2p-media-loader-core/src/utils/queue.ts @@ -10,7 +10,7 @@ export type QueueItem = { segment: Segment; statuses: SegmentPlaybackStatuses }; export function* generateQueue( lastRequestedSegment: Readonly, playback: Readonly, - settings: PlaybackTimeWindowsSettings + settings: PlaybackTimeWindowsSettings, ): Generator { const { localId: requestedSegmentId, stream } = lastRequestedSegment; @@ -37,7 +37,7 @@ export function* generateQueue( const secondStatuses = getSegmentPlaybackStatuses( second, playback, - settings + settings, ); if (isNotActualStatuses(secondStatuses)) return; diff --git a/packages/p2p-media-loader-core/src/utils/stream.ts b/packages/p2p-media-loader-core/src/utils/stream.ts index 24c78768..3dc81824 100644 --- a/packages/p2p-media-loader-core/src/utils/stream.ts +++ b/packages/p2p-media-loader-core/src/utils/stream.ts @@ -21,7 +21,7 @@ const PEER_PROTOCOL_VERSION = "V1"; export function getStreamExternalId( manifestResponseUrl: string, - stream: Readonly + stream: Readonly, ): string { const { type, index } = stream; return `${PEER_PROTOCOL_VERSION}:${manifestResponseUrl}-${type}-${index}`; @@ -29,7 +29,7 @@ export function getStreamExternalId( export function getSegmentFromStreamsMap( streams: Map, - segmentId: string + segmentId: string, ): Segment | undefined { for (const stream of streams.values()) { const segment = stream.segments.get(segmentId); @@ -39,7 +39,7 @@ export function getSegmentFromStreamsMap( export function getSegmentFromStreamByExternalId( stream: StreamWithSegments, - segmentExternalId: number + segmentExternalId: number, ): Segment | undefined { for (const segment of stream.segments.values()) { if (segment.externalId === segmentExternalId) return segment; @@ -65,7 +65,7 @@ export function getSegmentAvgDuration(stream: StreamWithSegments) { export function isSegmentActualInPlayback( segment: Readonly, playback: Playback, - timeWindowsSettings: PlaybackTimeWindowsSettings + timeWindowsSettings: PlaybackTimeWindowsSettings, ): boolean { const { isHighDemand = false, @@ -78,7 +78,7 @@ export function isSegmentActualInPlayback( export function getSegmentPlaybackStatuses( segment: Segment, playback: Playback, - timeWindowsSettings: PlaybackTimeWindowsSettings + timeWindowsSettings: PlaybackTimeWindowsSettings, ): SegmentPlaybackStatuses { const { highDemandTimeWindow, @@ -103,7 +103,7 @@ export function getSegmentPlaybackStatuses( function isSegmentInTimeWindow( segment: Segment, playback: Playback, - timeWindowLength: number + timeWindowLength: number, ) { const { startTime, endTime } = segment; const { position, rate } = playback; diff --git a/packages/p2p-media-loader-core/src/utils/utils.ts b/packages/p2p-media-loader-core/src/utils/utils.ts index 862c1577..ee9977cb 100644 --- a/packages/p2p-media-loader-core/src/utils/utils.ts +++ b/packages/p2p-media-loader-core/src/utils/utils.ts @@ -17,7 +17,7 @@ export function getControlledPromise() { export function joinChunks( chunks: Uint8Array[], - totalBytes?: number + totalBytes?: number, ): Uint8Array { if (totalBytes === undefined) { totalBytes = chunks.reduce((sum, chunk) => sum + chunk.byteLength, 0); diff --git a/packages/p2p-media-loader-hlsjs/src/engine.ts b/packages/p2p-media-loader-hlsjs/src/engine.ts index 2b1f48f6..682df3cf 100644 --- a/packages/p2p-media-loader-hlsjs/src/engine.ts +++ b/packages/p2p-media-loader-hlsjs/src/engine.ts @@ -55,41 +55,41 @@ export class Engine { hls[method]( "hlsManifestLoaded" as Events.MANIFEST_LOADED, - this.handleManifestLoaded + this.handleManifestLoaded, ); hls[method]( "hlsLevelSwitching" as Events.LEVEL_SWITCHING, - this.handleLevelSwitching + this.handleLevelSwitching, ); hls[method]( "hlsLevelUpdated" as Events.LEVEL_UPDATED, - this.handleLevelUpdated + this.handleLevelUpdated, ); hls[method]( "hlsAudioTrackLoaded" as Events.AUDIO_TRACK_LOADED, - this.handleLevelUpdated + this.handleLevelUpdated, ); hls[method]("hlsDestroying" as Events.DESTROYING, this.destroy); hls[method]( "hlsMediaAttaching" as Events.MEDIA_ATTACHING, - this.destroyCore + this.destroyCore, ); hls[method]( "hlsManifestLoading" as Events.MANIFEST_LOADING, - this.destroyCore + this.destroyCore, ); hls[method]( "hlsMediaDetached" as Events.MEDIA_DETACHED, - this.handleMediaDetached + this.handleMediaDetached, ); hls[method]( "hlsMediaAttached" as Events.MEDIA_ATTACHED, - this.handleMediaAttached + this.handleMediaAttached, ); } private updateMediaElementEventHandlers = ( - type: "register" | "unregister" + type: "register" | "unregister", ) => { const media = this.currentHlsInstance?.media; if (!media) return; @@ -116,7 +116,7 @@ export class Engine { private handleLevelUpdated = ( event: string, - data: LevelUpdatedData | AudioTrackLoadedData + data: LevelUpdatedData | AudioTrackLoadedData, ) => { this.core.setIsLive(data.details.live); this.segmentManager.updatePlaylist(data); diff --git a/packages/p2p-media-loader-hlsjs/src/fragment-loader.ts b/packages/p2p-media-loader-hlsjs/src/fragment-loader.ts index d4887c45..ff40ed23 100644 --- a/packages/p2p-media-loader-hlsjs/src/fragment-loader.ts +++ b/packages/p2p-media-loader-hlsjs/src/fragment-loader.ts @@ -44,7 +44,7 @@ export class FragmentLoaderBase implements Loader { async load( context: FragmentLoaderContext, config: LoaderConfiguration, - callbacks: LoaderCallbacks + callbacks: LoaderCallbacks, ) { this.context = context; this.config = config; @@ -54,7 +54,7 @@ export class FragmentLoaderBase implements Loader { const { rangeStart: start, rangeEnd: end } = context; const byteRange = Utils.getByteRange( start, - end !== undefined ? end - 1 : undefined + end !== undefined ? end - 1 : undefined, ); this.segmentId = Utils.getSegmentLocalId(context.url, byteRange); @@ -71,7 +71,7 @@ export class FragmentLoaderBase implements Loader { stats.loading = getLoadingStat( this.response.bandwidth, loadedBytes, - performance.now() + performance.now(), ); stats.total = stats.loaded = loadedBytes; @@ -80,14 +80,14 @@ export class FragmentLoaderBase implements Loader { this.stats, context, this.response.data, - undefined + undefined, ); } callbacks.onSuccess( { data: this.response.data, url: context.url }, this.stats, context, - undefined + undefined, ); }; @@ -149,7 +149,7 @@ export class FragmentLoaderBase implements Loader { function getLoadingStat( targetBitrate: number, loadedBytes: number, - loadingEndTime: number + loadingEndTime: number, ) { const bits = loadedBytes * 8; const timeForLoading = (bits / targetBitrate) * 1000; diff --git a/packages/p2p-media-loader-hlsjs/src/playlist-loader.ts b/packages/p2p-media-loader-hlsjs/src/playlist-loader.ts index b6f56d18..f5bacc7d 100644 --- a/packages/p2p-media-loader-hlsjs/src/playlist-loader.ts +++ b/packages/p2p-media-loader-hlsjs/src/playlist-loader.ts @@ -22,7 +22,7 @@ export class PlaylistLoaderBase implements Loader { async load( context: LoaderContext, config: LoaderConfiguration, - callbacks: LoaderCallbacks + callbacks: LoaderCallbacks, ) { this.defaultLoader.load(context, config, callbacks); } diff --git a/packages/p2p-media-loader-hlsjs/src/segment-mananger.ts b/packages/p2p-media-loader-hlsjs/src/segment-mananger.ts index 5e0c42b4..46289dce 100644 --- a/packages/p2p-media-loader-hlsjs/src/segment-mananger.ts +++ b/packages/p2p-media-loader-hlsjs/src/segment-mananger.ts @@ -60,7 +60,7 @@ export class SegmentManager { const [start, end] = fragByteRange; const byteRange = Utils.getByteRange( start, - end !== undefined ? end - 1 : undefined + end !== undefined ? end - 1 : undefined, ); const segmentLocalId = Utils.getSegmentLocalId(responseUrl, byteRange); segmentToRemoveIds.delete(segmentLocalId); diff --git a/packages/p2p-media-loader-hlsjs/src/utils.ts b/packages/p2p-media-loader-hlsjs/src/utils.ts index d0933ffd..10a0ca22 100644 --- a/packages/p2p-media-loader-hlsjs/src/utils.ts +++ b/packages/p2p-media-loader-hlsjs/src/utils.ts @@ -2,7 +2,7 @@ import { ByteRange } from "p2p-media-loader-core"; export function getSegmentLocalId( segmentRequestUrl: string, - byteRange?: ByteRange + byteRange?: ByteRange, ) { if (!byteRange) return segmentRequestUrl; return `${segmentRequestUrl}|${byteRange.start}-${byteRange.end}`; @@ -10,7 +10,7 @@ export function getSegmentLocalId( export function getByteRange( rangeStart: number | undefined, - rangeEnd: number | undefined + rangeEnd: number | undefined, ): ByteRange | undefined { if ( rangeStart !== undefined && diff --git a/packages/p2p-media-loader-shaka/src/engine.ts b/packages/p2p-media-loader-shaka/src/engine.ts index 31f8bec0..fbc1b2b9 100644 --- a/packages/p2p-media-loader-shaka/src/engine.ts +++ b/packages/p2p-media-loader-shaka/src/engine.ts @@ -38,7 +38,7 @@ export class Engine { this.player.configure("manifest.defaultPresentationDelay", LIVE_EDGE_DELAY); this.player.configure( "manifest.dash.ignoreSuggestedPresentationDelay", - true + true, ); this.player.configure("streaming.useNativeHlsOnSafari", false); this.updatePlayerEventHandlers("register"); @@ -108,7 +108,7 @@ export class Engine { }; private updateMediaElementEventHandlers = ( - type: "register" | "unregister" + type: "register" | "unregister", ) => { const media = this.player?.getMediaElement(); if (!media) return; @@ -142,7 +142,7 @@ export class Engine { Parser.registerParserByMime("application/x-mpegurl", hlsParserFactory); Parser.registerParserByMime( "application/vnd.apple.mpegurl", - hlsParserFactory + hlsParserFactory, ); } diff --git a/packages/p2p-media-loader-shaka/src/loading-handler.ts b/packages/p2p-media-loader-shaka/src/loading-handler.ts index ab4b90cd..a5e616ac 100644 --- a/packages/p2p-media-loader-shaka/src/loading-handler.ts +++ b/packages/p2p-media-loader-shaka/src/loading-handler.ts @@ -18,7 +18,7 @@ export class Loader { constructor( private readonly shaka: Shaka, private readonly core: Core, - readonly streamInfo: StreamInfo + readonly streamInfo: StreamInfo, ) {} private defaultLoad() { @@ -51,7 +51,7 @@ export class Loader { private loadSegment( segmentUrl: string, - byteRangeString: string + byteRangeString: string, ): LoadingHandlerResult { const segmentId = Utils.getSegmentLocalId(segmentUrl, byteRangeString); if (!this.core.hasSegment(segmentId)) return this.defaultLoad(); @@ -68,7 +68,7 @@ export class Loader { originalUri: segmentUrl, timeMs: getLoadingDurationBasedOnBandwidth( bandwidth, - data.byteLength + data.byteLength, ), }; } catch (error) { @@ -79,7 +79,7 @@ export class Loader { throw new ShakaError( ShakaError.Severity.RECOVERABLE, ShakaError.Category.NETWORK, - this.shaka.util.Error.Code.OPERATION_ABORTED + this.shaka.util.Error.Code.OPERATION_ABORTED, ); } } @@ -88,7 +88,7 @@ export class Loader { }; return new this.shaka.util.AbortableOperation(loadSegment(), async () => - this.core.abortSegmentLoading(segmentId) + this.core.abortSegmentLoading(segmentId), ); } @@ -100,7 +100,7 @@ export class Loader { function getLoadingDurationBasedOnBandwidth( bandwidth: number, - bytesLoaded: number + bytesLoaded: number, ) { const bits = bytesLoaded * 8; return Math.round(bits / bandwidth) * 1000; diff --git a/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts b/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts index e921456f..2e9d60b5 100644 --- a/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts +++ b/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts @@ -16,7 +16,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { constructor( shaka: Readonly, - private readonly originalManifestParser: shaka.extern.ManifestParser + private readonly originalManifestParser: shaka.extern.ManifestParser, ) { this.isHls = this.originalManifestParser instanceof shaka.hls.HlsParser; } @@ -42,14 +42,14 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { async start( uri: string, - playerInterface: shaka.extern.ManifestParser.PlayerInterface + playerInterface: shaka.extern.ManifestParser.PlayerInterface, ): Promise { const { p2pml } = playerInterface.networkingEngine as HookedNetworkingEngine; this.setP2PMediaLoaderData(p2pml); const manifest = await this.originalManifestParser.start( uri, - playerInterface + playerInterface, ); if (!p2pml) return manifest; @@ -71,7 +71,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { onExpirationUpdated(sessionId: string, expiration: number) { return this.originalManifestParser.onExpirationUpdated( sessionId, - expiration + expiration, ); } @@ -83,7 +83,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { const processStream = ( stream: shaka.extern.Stream, type: StreamType, - order: number + order: number, ) => { this.hookSegmentIndex(stream); segmentManager.setStream(stream as HookedStream, type, order); @@ -111,7 +111,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { const substituteSegmentIndexGet = ( segmentIndex: shaka.media.SegmentIndex, - callFromCreateSegmentIndexMethod = false + callFromCreateSegmentIndexMethod = false, ) => { let prevReference: shaka.media.SegmentReference | null = null; let prevFirstItemReference: shaka.media.SegmentReference; @@ -232,7 +232,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { (map) => { const [key, value] = map.entries().next().value ?? []; return typeof key === "number" && typeof value === "number"; - } + }, ); if (!mediaSequenceTimeMap) continue; variant.stream.mediaSequenceTimeMap = mediaSequenceTimeMap as Map< diff --git a/packages/p2p-media-loader-shaka/src/segment-manager.ts b/packages/p2p-media-loader-shaka/src/segment-manager.ts index 999c584c..efafb8b6 100644 --- a/packages/p2p-media-loader-shaka/src/segment-manager.ts +++ b/packages/p2p-media-loader-shaka/src/segment-manager.ts @@ -34,7 +34,7 @@ export class SegmentManager { updateStreamSegments( shakaStream: HookedStream, - segmentReferences?: shaka.media.SegmentReference[] + segmentReferences?: shaka.media.SegmentReference[], ) { const stream = this.core.getStream(shakaStream.id.toString()); if (!stream) return; @@ -58,13 +58,13 @@ export class SegmentManager { private processDashSegmentReferences( managerStream: StreamWithReadonlySegments, - segmentReferences: shaka.media.SegmentReference[] + segmentReferences: shaka.media.SegmentReference[], ) { const staleSegmentsIds = new Set(managerStream.segments.keys()); const newSegments: SegmentBase[] = []; for (const reference of segmentReferences) { const externalId = Math.trunc( - reference.getStartTime() / SEGMENT_ID_RESOLUTION_IN_SECONDS + reference.getStartTime() / SEGMENT_ID_RESOLUTION_IN_SECONDS, ); const segmentLocalId = Utils.getSegmentLocalIdFromReference(reference); @@ -87,7 +87,7 @@ export class SegmentManager { private processHlsSegmentReferences( managerStream: StreamWithReadonlySegments, - segmentReferences: shaka.media.SegmentReference[] + segmentReferences: shaka.media.SegmentReference[], ) { const { segments } = managerStream; const lastMediaSequence = Utils.getStreamLastMediaSequence(managerStream); @@ -143,7 +143,7 @@ function* itemsBackwards(items: T[]) { function* nSegmentsBackwards( segments: ReadonlyMap, - amount: number + amount: number, ) { let i = 0; for (const segment of segments.values()) { diff --git a/packages/p2p-media-loader-shaka/src/stream-utils.ts b/packages/p2p-media-loader-shaka/src/stream-utils.ts index 563a50ee..121c01fb 100644 --- a/packages/p2p-media-loader-shaka/src/stream-utils.ts +++ b/packages/p2p-media-loader-shaka/src/stream-utils.ts @@ -27,7 +27,7 @@ export function createSegment({ } export function getSegmentLocalIdFromReference( - segmentReference: shaka.media.SegmentReference + segmentReference: shaka.media.SegmentReference, ) { const { url, byteRange } = getSegmentInfoFromReference(segmentReference); return getSegmentLocalId(url, byteRange); @@ -46,7 +46,7 @@ export function getSegmentLocalId(url: string, byteRange?: ByteRange | string) { } export function getByteRangeFromHeaderString( - rangeStr: string | undefined + rangeStr: string | undefined, ): ByteRange | undefined { if (!rangeStr || !rangeStr.includes("bytes=")) return undefined; @@ -59,7 +59,7 @@ export function getByteRangeFromHeaderString( } export function getSegmentInfoFromReference( - segmentReference: shaka.media.SegmentReference + segmentReference: shaka.media.SegmentReference, ) { const uris = segmentReference.getUris(); const responseUrl = uris[1] ?? uris[0]; @@ -77,7 +77,7 @@ export function getSegmentInfoFromReference( } export function getStreamLastMediaSequence( - stream: StreamWithReadonlySegments + stream: StreamWithReadonlySegments, ): number | undefined { const { shakaStream } = stream; const map = shakaStream.mediaSequenceTimeMap; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 298007ef..9a89af1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -24,12 +24,9 @@ importers: eslint: specifier: ^8.56.0 version: 8.56.0 - eslint-plugin-prettier: - specifier: ^5.1.3 - version: 5.1.3(eslint@8.56.0)(prettier@3.1.1) prettier: specifier: ^3.1.1 - version: 3.1.1 + version: 3.2.1 rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -96,7 +93,7 @@ importers: dependencies: hls.js: specifier: ^1.5.0 - version: 1.5.0 + version: 1.5.1 p2p-media-loader-core: specifier: workspace:* version: link:../p2p-media-loader-core @@ -108,7 +105,7 @@ importers: version: link:../p2p-media-loader-core shaka-player: specifier: ^4.7.3 - version: 4.7.3 + version: 4.7.4 packages: @@ -122,7 +119,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 dev: true /@babel/code-frame@7.23.5: @@ -167,7 +164,7 @@ packages: dependencies: '@babel/types': 7.23.6 '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 jsesc: 2.5.2 dev: true @@ -592,11 +589,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} dependencies: - '@humanwhocodes/object-schema': 2.0.1 + '@humanwhocodes/object-schema': 2.0.2 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: @@ -608,8 +605,8 @@ packages: engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: true /@isaacs/cliui@8.0.2: @@ -630,7 +627,7 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 dev: true /@jridgewell/resolve-uri@3.1.1: @@ -647,8 +644,8 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.20: - resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} + /@jridgewell/trace-mapping@0.3.21: + resolution: {integrity: sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==} dependencies: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 @@ -682,11 +679,6 @@ packages: dev: true optional: true - /@pkgr/core@0.1.0: - resolution: {integrity: sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dev: true - /@rollup/plugin-inject@5.0.5: resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==} engines: {node: '>=14.0.0'} @@ -715,104 +707,104 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/rollup-android-arm-eabi@4.9.4: - resolution: {integrity: sha512-ub/SN3yWqIv5CWiAZPHVS1DloyZsJbtXmX4HxUTIpS0BHm9pW5iYBo2mIZi+hE3AeiTzHz33blwSnhdUo+9NpA==} + /@rollup/rollup-android-arm-eabi@4.9.5: + resolution: {integrity: sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.9.4: - resolution: {integrity: sha512-ehcBrOR5XTl0W0t2WxfTyHCR/3Cq2jfb+I4W+Ch8Y9b5G+vbAecVv0Fx/J1QKktOrgUYsIKxWAKgIpvw56IFNA==} + /@rollup/rollup-android-arm64@4.9.5: + resolution: {integrity: sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.9.4: - resolution: {integrity: sha512-1fzh1lWExwSTWy8vJPnNbNM02WZDS8AW3McEOb7wW+nPChLKf3WG2aG7fhaUmfX5FKw9zhsF5+MBwArGyNM7NA==} + /@rollup/rollup-darwin-arm64@4.9.5: + resolution: {integrity: sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.9.4: - resolution: {integrity: sha512-Gc6cukkF38RcYQ6uPdiXi70JB0f29CwcQ7+r4QpfNpQFVHXRd0DfWFidoGxjSx1DwOETM97JPz1RXL5ISSB0pA==} + /@rollup/rollup-darwin-x64@4.9.5: + resolution: {integrity: sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.4: - resolution: {integrity: sha512-g21RTeFzoTl8GxosHbnQZ0/JkuFIB13C3T7Y0HtKzOXmoHhewLbVTFBQZu+z5m9STH6FZ7L/oPgU4Nm5ErN2fw==} + /@rollup/rollup-linux-arm-gnueabihf@4.9.5: + resolution: {integrity: sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.4: - resolution: {integrity: sha512-TVYVWD/SYwWzGGnbfTkrNpdE4HON46orgMNHCivlXmlsSGQOx/OHHYiQcMIOx38/GWgwr/po2LBn7wypkWw/Mg==} + /@rollup/rollup-linux-arm64-gnu@4.9.5: + resolution: {integrity: sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.9.4: - resolution: {integrity: sha512-XcKvuendwizYYhFxpvQ3xVpzje2HHImzg33wL9zvxtj77HvPStbSGI9czrdbfrf8DGMcNNReH9pVZv8qejAQ5A==} + /@rollup/rollup-linux-arm64-musl@4.9.5: + resolution: {integrity: sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.4: - resolution: {integrity: sha512-LFHS/8Q+I9YA0yVETyjonMJ3UA+DczeBd/MqNEzsGSTdNvSJa1OJZcSH8GiXLvcizgp9AlHs2walqRcqzjOi3A==} + /@rollup/rollup-linux-riscv64-gnu@4.9.5: + resolution: {integrity: sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.9.4: - resolution: {integrity: sha512-dIYgo+j1+yfy81i0YVU5KnQrIJZE8ERomx17ReU4GREjGtDW4X+nvkBak2xAUpyqLs4eleDSj3RrV72fQos7zw==} + /@rollup/rollup-linux-x64-gnu@4.9.5: + resolution: {integrity: sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.9.4: - resolution: {integrity: sha512-RoaYxjdHQ5TPjaPrLsfKqR3pakMr3JGqZ+jZM0zP2IkDtsGa4CqYaWSfQmZVgFUCgLrTnzX+cnHS3nfl+kB6ZQ==} + /@rollup/rollup-linux-x64-musl@4.9.5: + resolution: {integrity: sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.4: - resolution: {integrity: sha512-T8Q3XHV+Jjf5e49B4EAaLKV74BbX7/qYBRQ8Wop/+TyyU0k+vSjiLVSHNWdVd1goMjZcbhDmYZUYW5RFqkBNHQ==} + /@rollup/rollup-win32-arm64-msvc@4.9.5: + resolution: {integrity: sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.4: - resolution: {integrity: sha512-z+JQ7JirDUHAsMecVydnBPWLwJjbppU+7LZjffGf+Jvrxq+dVjIE7By163Sc9DKc3ADSU50qPVw0KonBS+a+HQ==} + /@rollup/rollup-win32-ia32-msvc@4.9.5: + resolution: {integrity: sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.9.4: - resolution: {integrity: sha512-LfdGXCV9rdEify1oxlN9eamvDSjv9md9ZVMAbNHA87xqIfFCxImxan9qZ8+Un54iK2nnqPlbnSi4R54ONtbWBw==} + /@rollup/rollup-win32-x64-msvc@4.9.5: + resolution: {integrity: sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==} cpu: [x64] os: [win32] requiresBuild: true @@ -1179,7 +1171,7 @@ packages: /axios@1.2.3(debug@4.3.4): resolution: {integrity: sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==} dependencies: - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.5(debug@4.3.4) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -1348,7 +1340,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001576 - electron-to-chromium: 1.4.626 + electron-to-chromium: 1.4.630 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true @@ -1642,8 +1634,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.626: - resolution: {integrity: sha512-f7/be56VjRRQk+Ric6PmIrEtPcIqsn3tElyAu9Sh6egha2VLJ82qwkcOdcnT06W+Pb6RUulV1ckzrGbKzVcTHg==} + /electron-to-chromium@1.4.630: + resolution: {integrity: sha512-osHqhtjojpCsACVnuD11xO5g9xaCyw7Qqn/C2KParkMv42i8jrJJgx3g7mkHfpxwhy9MnOJr8+pKOdZ7qzgizg==} dev: true /elliptic@6.5.4: @@ -1720,26 +1712,6 @@ packages: engines: {node: '>=10'} dev: true - /eslint-plugin-prettier@5.1.3(eslint@8.56.0)(prettier@3.1.1): - resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - '@types/eslint': '>=8.0.0' - eslint: '>=8.0.0' - eslint-config-prettier: '*' - prettier: '>=3.0.0' - peerDependenciesMeta: - '@types/eslint': - optional: true - eslint-config-prettier: - optional: true - dependencies: - eslint: 8.56.0 - prettier: 3.1.1 - prettier-linter-helpers: 1.0.0 - synckit: 0.8.8 - dev: true - /eslint-plugin-react-hooks@4.6.0(eslint@8.56.0): resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} @@ -1779,7 +1751,7 @@ packages: '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.56.0 - '@humanwhocodes/config-array': 0.11.13 + '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 @@ -1875,10 +1847,6 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - dev: true - /fast-fifo@1.3.2: resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} dev: false @@ -1951,8 +1919,8 @@ packages: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} dev: true - /follow-redirects@1.15.4(debug@4.3.4): - resolution: {integrity: sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==} + /follow-redirects@1.15.5(debug@4.3.4): + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -2161,8 +2129,8 @@ packages: function-bind: 1.1.2 dev: true - /hls.js@1.5.0: - resolution: {integrity: sha512-V7jzv1c/G38kZcg6BVgimVj5g/bVMebHRrIrln6R773mIRBDnp+/knp4ntThk3T1Ztjat9n2x3Ak3BPu5wKeYA==} + /hls.js@1.5.1: + resolution: {integrity: sha512-SsUSlpyjOGnwBhVrVEG6vRFPU2SAJ0gUqrFdGeo7YPbOC0vuWK0TDMyp7n3QiaBC/Wkic771uqPnnVdT8/x+3Q==} dev: false /hmac-drbg@1.0.1: @@ -2526,6 +2494,7 @@ packages: /node-gyp-build@4.8.0: resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} hasBin: true + requiresBuild: true dev: false /node-releases@2.0.14: @@ -2725,15 +2694,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-linter-helpers@1.0.0: - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} - engines: {node: '>=6.0.0'} - dependencies: - fast-diff: 1.3.0 - dev: true - - /prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} + /prettier@3.2.1: + resolution: {integrity: sha512-qSUWshj1IobVbKc226Gw2pync27t0Kf0EdufZa9j7uBSJay1CC+B3K5lAAZoqgX3ASiKuWsk6OmzKRetXNObWg==} engines: {node: '>=14'} hasBin: true dev: true @@ -2882,26 +2844,26 @@ packages: inherits: 2.0.4 dev: true - /rollup@4.9.4: - resolution: {integrity: sha512-2ztU7pY/lrQyXSCnnoU4ICjT/tCG9cdH3/G25ERqE3Lst6vl2BCM5hL2Nw+sslAvAf+ccKsAq1SkKQALyqhR7g==} + /rollup@4.9.5: + resolution: {integrity: sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.4 - '@rollup/rollup-android-arm64': 4.9.4 - '@rollup/rollup-darwin-arm64': 4.9.4 - '@rollup/rollup-darwin-x64': 4.9.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.4 - '@rollup/rollup-linux-arm64-gnu': 4.9.4 - '@rollup/rollup-linux-arm64-musl': 4.9.4 - '@rollup/rollup-linux-riscv64-gnu': 4.9.4 - '@rollup/rollup-linux-x64-gnu': 4.9.4 - '@rollup/rollup-linux-x64-musl': 4.9.4 - '@rollup/rollup-win32-arm64-msvc': 4.9.4 - '@rollup/rollup-win32-ia32-msvc': 4.9.4 - '@rollup/rollup-win32-x64-msvc': 4.9.4 + '@rollup/rollup-android-arm-eabi': 4.9.5 + '@rollup/rollup-android-arm64': 4.9.5 + '@rollup/rollup-darwin-arm64': 4.9.5 + '@rollup/rollup-darwin-x64': 4.9.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.5 + '@rollup/rollup-linux-arm64-gnu': 4.9.5 + '@rollup/rollup-linux-arm64-musl': 4.9.5 + '@rollup/rollup-linux-riscv64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-musl': 4.9.5 + '@rollup/rollup-win32-arm64-msvc': 4.9.5 + '@rollup/rollup-win32-ia32-msvc': 4.9.5 + '@rollup/rollup-win32-x64-msvc': 4.9.5 fsevents: 2.3.3 dev: true @@ -2963,8 +2925,8 @@ packages: safe-buffer: 5.2.1 dev: true - /shaka-player@4.7.3: - resolution: {integrity: sha512-bE/2+8rZpC8Ll2A+QMIQnHyg2LrDju3Kp2c+HjSW4ashjSvSqvkKGybATDgOoPSd45dxXn5wQr/sl6X7FqN2hA==} + /shaka-player@4.7.4: + resolution: {integrity: sha512-FbEmXCcXqwk+reZ8Crlra4VA9UnJTrVgWmeaeOaeRZ1QG01HESJZ60fZAhNAPNyhvXbSAiangYuASyJq8ZI1fQ==} engines: {node: '>=14'} dependencies: eme-encryption-scheme-polyfill: 2.1.1 @@ -3111,14 +3073,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /synckit@0.8.8: - resolution: {integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@pkgr/core': 0.1.0 - tslib: 2.6.2 - dev: true - /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true @@ -3151,10 +3105,6 @@ packages: typescript: 5.3.3 dev: true - /tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - dev: true - /tty-browserify@0.0.1: resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} dev: true @@ -3275,7 +3225,7 @@ packages: dependencies: esbuild: 0.19.11 postcss: 8.4.33 - rollup: 4.9.4 + rollup: 4.9.5 optionalDependencies: fsevents: 2.3.3 dev: true