@livepeer-frameworks/player-core 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +19493 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/index.js +19398 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/player.css +2140 -0
- package/dist/types/core/ABRController.d.ts +164 -0
- package/dist/types/core/CodecUtils.d.ts +54 -0
- package/dist/types/core/Disposable.d.ts +61 -0
- package/dist/types/core/EventEmitter.d.ts +73 -0
- package/dist/types/core/GatewayClient.d.ts +144 -0
- package/dist/types/core/InteractionController.d.ts +121 -0
- package/dist/types/core/LiveDurationProxy.d.ts +102 -0
- package/dist/types/core/MetaTrackManager.d.ts +220 -0
- package/dist/types/core/MistReporter.d.ts +163 -0
- package/dist/types/core/MistSignaling.d.ts +148 -0
- package/dist/types/core/PlayerController.d.ts +665 -0
- package/dist/types/core/PlayerInterface.d.ts +230 -0
- package/dist/types/core/PlayerManager.d.ts +182 -0
- package/dist/types/core/PlayerRegistry.d.ts +27 -0
- package/dist/types/core/QualityMonitor.d.ts +184 -0
- package/dist/types/core/ScreenWakeLockManager.d.ts +70 -0
- package/dist/types/core/SeekingUtils.d.ts +142 -0
- package/dist/types/core/StreamStateClient.d.ts +108 -0
- package/dist/types/core/SubtitleManager.d.ts +111 -0
- package/dist/types/core/TelemetryReporter.d.ts +79 -0
- package/dist/types/core/TimeFormat.d.ts +97 -0
- package/dist/types/core/TimerManager.d.ts +83 -0
- package/dist/types/core/UrlUtils.d.ts +81 -0
- package/dist/types/core/detector.d.ts +149 -0
- package/dist/types/core/index.d.ts +49 -0
- package/dist/types/core/scorer.d.ts +167 -0
- package/dist/types/core/selector.d.ts +9 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/players/DashJsPlayer.d.ts +102 -0
- package/dist/types/players/HlsJsPlayer.d.ts +70 -0
- package/dist/types/players/MewsWsPlayer/SourceBufferManager.d.ts +119 -0
- package/dist/types/players/MewsWsPlayer/WebSocketManager.d.ts +60 -0
- package/dist/types/players/MewsWsPlayer/index.d.ts +220 -0
- package/dist/types/players/MewsWsPlayer/types.d.ts +89 -0
- package/dist/types/players/MistPlayer.d.ts +25 -0
- package/dist/types/players/MistWebRTCPlayer/index.d.ts +133 -0
- package/dist/types/players/NativePlayer.d.ts +143 -0
- package/dist/types/players/VideoJsPlayer.d.ts +59 -0
- package/dist/types/players/WebCodecsPlayer/JitterBuffer.d.ts +118 -0
- package/dist/types/players/WebCodecsPlayer/LatencyProfiles.d.ts +64 -0
- package/dist/types/players/WebCodecsPlayer/RawChunkParser.d.ts +63 -0
- package/dist/types/players/WebCodecsPlayer/SyncController.d.ts +174 -0
- package/dist/types/players/WebCodecsPlayer/WebSocketController.d.ts +164 -0
- package/dist/types/players/WebCodecsPlayer/index.d.ts +149 -0
- package/dist/types/players/WebCodecsPlayer/polyfills/MediaStreamTrackGenerator.d.ts +105 -0
- package/dist/types/players/WebCodecsPlayer/types.d.ts +395 -0
- package/dist/types/players/WebCodecsPlayer/worker/decoder.worker.d.ts +13 -0
- package/dist/types/players/WebCodecsPlayer/worker/types.d.ts +197 -0
- package/dist/types/players/index.d.ts +14 -0
- package/dist/types/styles/index.d.ts +11 -0
- package/dist/types/types.d.ts +363 -0
- package/dist/types/vanilla/FrameWorksPlayer.d.ts +143 -0
- package/dist/types/vanilla/index.d.ts +19 -0
- package/dist/workers/decoder.worker.js +989 -0
- package/dist/workers/decoder.worker.js.map +1 -0
- package/package.json +80 -0
- package/src/core/ABRController.ts +550 -0
- package/src/core/CodecUtils.ts +257 -0
- package/src/core/Disposable.ts +120 -0
- package/src/core/EventEmitter.ts +113 -0
- package/src/core/GatewayClient.ts +439 -0
- package/src/core/InteractionController.ts +712 -0
- package/src/core/LiveDurationProxy.ts +270 -0
- package/src/core/MetaTrackManager.ts +753 -0
- package/src/core/MistReporter.ts +543 -0
- package/src/core/MistSignaling.ts +346 -0
- package/src/core/PlayerController.ts +2829 -0
- package/src/core/PlayerInterface.ts +432 -0
- package/src/core/PlayerManager.ts +900 -0
- package/src/core/PlayerRegistry.ts +149 -0
- package/src/core/QualityMonitor.ts +597 -0
- package/src/core/ScreenWakeLockManager.ts +163 -0
- package/src/core/SeekingUtils.ts +364 -0
- package/src/core/StreamStateClient.ts +457 -0
- package/src/core/SubtitleManager.ts +297 -0
- package/src/core/TelemetryReporter.ts +308 -0
- package/src/core/TimeFormat.ts +205 -0
- package/src/core/TimerManager.ts +209 -0
- package/src/core/UrlUtils.ts +179 -0
- package/src/core/detector.ts +382 -0
- package/src/core/index.ts +140 -0
- package/src/core/scorer.ts +553 -0
- package/src/core/selector.ts +16 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +75 -0
- package/src/lib/utils.ts +6 -0
- package/src/players/DashJsPlayer.ts +642 -0
- package/src/players/HlsJsPlayer.ts +483 -0
- package/src/players/MewsWsPlayer/SourceBufferManager.ts +572 -0
- package/src/players/MewsWsPlayer/WebSocketManager.ts +241 -0
- package/src/players/MewsWsPlayer/index.ts +1065 -0
- package/src/players/MewsWsPlayer/types.ts +106 -0
- package/src/players/MistPlayer.ts +188 -0
- package/src/players/MistWebRTCPlayer/index.ts +703 -0
- package/src/players/NativePlayer.ts +820 -0
- package/src/players/VideoJsPlayer.ts +643 -0
- package/src/players/WebCodecsPlayer/JitterBuffer.ts +299 -0
- package/src/players/WebCodecsPlayer/LatencyProfiles.ts +151 -0
- package/src/players/WebCodecsPlayer/RawChunkParser.ts +151 -0
- package/src/players/WebCodecsPlayer/SyncController.ts +456 -0
- package/src/players/WebCodecsPlayer/WebSocketController.ts +564 -0
- package/src/players/WebCodecsPlayer/index.ts +1650 -0
- package/src/players/WebCodecsPlayer/polyfills/MediaStreamTrackGenerator.ts +379 -0
- package/src/players/WebCodecsPlayer/types.ts +542 -0
- package/src/players/WebCodecsPlayer/worker/decoder.worker.ts +1360 -0
- package/src/players/WebCodecsPlayer/worker/types.ts +276 -0
- package/src/players/index.ts +22 -0
- package/src/styles/animations.css +21 -0
- package/src/styles/index.ts +52 -0
- package/src/styles/player.css +2126 -0
- package/src/styles/tailwind.css +1015 -0
- package/src/types.ts +421 -0
- package/src/vanilla/FrameWorksPlayer.ts +367 -0
- package/src/vanilla/index.ts +22 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.worker.js","sources":["../../../src/players/WebCodecsPlayer/worker/decoder.worker.ts"],"sourcesContent":["/**\n * WebCodecs Decoder Worker\n *\n * Handles VideoDecoder and AudioDecoder in a dedicated worker thread.\n * This keeps decoding off the main thread for better performance.\n *\n * Features:\n * - Video/Audio pipeline management per track\n * - Frame scheduling based on timestamps and playback speed\n * - Stats collection and reporting\n * - Seek handling with queue flush\n */\n\nimport type {\n MainToWorkerMessage,\n WorkerToMainMessage,\n PipelineState,\n FrameTiming,\n DecodedFrame,\n VideoDecoderInit,\n AudioDecoderInit,\n} from './types';\nimport type { TrackInfo, PipelineStats, FrameTrackerStats } from '../types';\n\n// ============================================================================\n// Global State\n// ============================================================================\n\nconst pipelines = new Map<number, PipelineState>();\nlet debugging: boolean | 'verbose' = false;\nlet uidCounter = 0;\n\n// Frame timing state (shared across all pipelines)\nconst frameTiming: FrameTiming = {\n in: 0,\n decoded: 0,\n out: 0,\n speed: {\n main: 1,\n tweak: 1,\n combined: 1,\n },\n seeking: false,\n paused: false,\n serverTime: 0,\n};\n\n// Per-track wall-clock reference points for frame scheduling\n// Each track gets its own baseTime to handle different timestamp bases for A/V\nconst trackBaseTimes = new Map<number, number>();\n\n// Buffer warmup state - prevents initial jitter by waiting for buffer to build\n// Before warmup, frames are queued but not output\nlet warmupComplete = false;\nlet warmupStartTime: number | null = null;\nconst WARMUP_BUFFER_MS = 100; // Wait for ~100ms of frames before starting output\nconst WARMUP_TIMEOUT_MS = 300; // Reduced from 500ms - start faster to reduce latency\n\n/**\n * Get or initialize baseTime for a specific track\n */\nfunction getTrackBaseTime(idx: number, frameTimeMs: number, now: number): number {\n if (!trackBaseTimes.has(idx)) {\n trackBaseTimes.set(idx, now - frameTimeMs / frameTiming.speed.combined);\n log(`Track ${idx} baseTime: ${trackBaseTimes.get(idx)!.toFixed(0)} (first frame @ ${frameTimeMs.toFixed(0)}ms)`);\n }\n return trackBaseTimes.get(idx)!;\n}\n\n/**\n * Reset all track baseTimes (used during seek or reset)\n */\nfunction resetBaseTime(): void {\n trackBaseTimes.clear();\n log(`Reset all track baseTimes`);\n}\n\n// Stats update interval\nlet statsTimer: ReturnType<typeof setInterval> | null = null;\nconst STATS_INTERVAL_MS = 250;\n\n// Frame dropping stats (Phase 2B)\nlet totalFramesDropped = 0;\n\n// Chrome-recommended decoder queue threshold\n// Per Chrome WebCodecs best practices: drop when decodeQueueSize > 2\n// This ensures decoder doesn't fall too far behind before corrective action\nconst MAX_DECODER_QUEUE_SIZE = 2;\n\n// ============================================================================\n// Logging\n// ============================================================================\n\nfunction log(msg: string, level: 'info' | 'warn' | 'error' = 'info'): void {\n if (!debugging) return;\n\n const message: WorkerToMainMessage = {\n type: 'log',\n msg,\n level,\n uid: uidCounter++,\n };\n self.postMessage(message);\n}\n\nfunction logVerbose(msg: string): void {\n if (debugging !== 'verbose') return;\n log(msg);\n}\n\n// ============================================================================\n// Message Handling\n// ============================================================================\n\nself.onmessage = (event: MessageEvent<MainToWorkerMessage>) => {\n const msg = event.data;\n\n switch (msg.type) {\n case 'create':\n handleCreate(msg);\n break;\n\n case 'configure':\n handleConfigure(msg);\n break;\n\n case 'receive':\n handleReceive(msg);\n break;\n\n case 'setwritable':\n handleSetWritable(msg);\n break;\n\n case 'creategenerator':\n handleCreateGenerator(msg);\n break;\n\n case 'close':\n handleClose(msg);\n break;\n\n case 'frametiming':\n handleFrameTiming(msg);\n break;\n\n case 'seek':\n handleSeek(msg);\n break;\n\n case 'debugging':\n debugging = msg.value;\n log(`Debugging set to: ${msg.value}`);\n break;\n\n default:\n log(`Unknown message type: ${(msg as any).type}`, 'warn');\n }\n};\n\n// ============================================================================\n// Pipeline Management\n// ============================================================================\n\nfunction handleCreate(msg: MainToWorkerMessage & { type: 'create' }): void {\n const { idx, track, opts, uid } = msg;\n\n log(`Creating pipeline for track ${idx} (${track.type} ${track.codec})`);\n\n const pipeline: PipelineState = {\n idx,\n track,\n configured: false,\n closed: false,\n decoder: null,\n writable: null,\n writer: null,\n inputQueue: [],\n outputQueue: [],\n stats: {\n framesIn: 0,\n framesDecoded: 0,\n framesOut: 0,\n framesDropped: 0,\n lastInputTimestamp: 0,\n lastOutputTimestamp: 0,\n decoderQueueSize: 0,\n // Debug info for error diagnosis\n lastChunkType: '' as string,\n lastChunkSize: 0,\n lastChunkBytes: '' as string,\n },\n optimizeForLatency: opts.optimizeForLatency,\n };\n\n pipelines.set(idx, pipeline);\n\n // Start stats reporting if not already running\n if (!statsTimer) {\n statsTimer = setInterval(sendStats, STATS_INTERVAL_MS);\n }\n\n sendAck(uid, idx);\n}\n\nfunction handleConfigure(msg: MainToWorkerMessage & { type: 'configure' }): void {\n const { idx, header, uid } = msg;\n\n log(`Received configure for track ${idx}, header length=${header?.byteLength ?? 'null'}`);\n\n const pipeline = pipelines.get(idx);\n\n if (!pipeline) {\n log(`Cannot configure: pipeline ${idx} not found`, 'error');\n sendError(uid, idx, 'Pipeline not found');\n return;\n }\n\n // Skip if already configured and decoder is ready\n // This prevents duplicate configuration when both WS INIT and HTTP fallback fire\n if (pipeline.configured && pipeline.decoder && pipeline.decoder.state === 'configured') {\n log(`Track ${idx} already configured, skipping duplicate configure`);\n sendAck(uid, idx);\n return;\n }\n\n try {\n if (pipeline.track.type === 'video') {\n log(`Configuring video decoder for track ${idx}...`);\n configureVideoDecoder(pipeline, header);\n } else if (pipeline.track.type === 'audio') {\n log(`Configuring audio decoder for track ${idx}...`);\n configureAudioDecoder(pipeline, header);\n }\n\n pipeline.configured = true;\n log(`Successfully configured decoder for track ${idx}`);\n sendAck(uid, idx);\n } catch (err) {\n log(`Failed to configure decoder for track ${idx}: ${err}`, 'error');\n sendError(uid, idx, String(err));\n }\n}\n\nfunction configureVideoDecoder(pipeline: PipelineState, description?: Uint8Array): void {\n const track = pipeline.track;\n\n // Handle JPEG codec separately via ImageDecoder (Phase 2C)\n if (track.codec === 'JPEG' || track.codec.toLowerCase() === 'jpeg') {\n log('JPEG codec detected - will use ImageDecoder');\n pipeline.configured = true;\n // JPEG doesn't need a persistent decoder - each frame is decoded individually\n return;\n }\n\n // Close existing decoder if any (per rawws.js reconfiguration pattern)\n if (pipeline.decoder) {\n if (pipeline.decoder.state === 'configured') {\n try {\n pipeline.decoder.reset();\n } catch {\n // Ignore reset errors\n }\n }\n if (pipeline.decoder.state !== 'closed') {\n try {\n pipeline.decoder.close();\n } catch {\n // Ignore close errors\n }\n }\n pipeline.decoder = null;\n }\n\n // Match reference rawws.js configOpts pattern:\n // codec, optimizeForLatency, description + hw acceleration hint\n const config: VideoDecoderInit = {\n codec: track.codecstring || track.codec.toLowerCase(),\n optimizeForLatency: pipeline.optimizeForLatency,\n hardwareAcceleration: 'prefer-hardware',\n };\n\n // Pass description directly from WebSocket INIT data (per reference rawws.js line 1052)\n if (description && description.byteLength > 0) {\n config.description = description;\n log(`Configuring with description (${description.byteLength} bytes)`);\n } else {\n log(`No description provided - decoder may fail on H.264/HEVC`, 'warn');\n }\n\n log(`Configuring video decoder: ${config.codec}`);\n\n const decoder = new VideoDecoder({\n output: (frame: VideoFrame) => handleDecodedFrame(pipeline, frame),\n error: (err: DOMException) => handleDecoderError(pipeline, err),\n });\n\n decoder.configure(config as VideoDecoderConfig);\n pipeline.decoder = decoder;\n\n log(`Video decoder configured: ${config.codec}`);\n}\n\n/**\n * Map MistServer audio codec names to WebCodecs-compatible codec strings\n * Per W3C AAC WebCodecs Registration: https://www.w3.org/TR/webcodecs-aac-codec-registration/\n */\nfunction mapAudioCodec(codec: string, codecstring?: string): string {\n // If we have a full codec string like \"mp4a.40.2\", use it\n if (codecstring && codecstring.startsWith('mp4a.')) {\n return codecstring;\n }\n\n // Map common MistServer codec names to WebCodecs codec strings\n const normalized = codec.toLowerCase();\n switch (normalized) {\n case 'aac':\n case 'mp4a':\n return 'mp4a.40.2'; // AAC-LC\n case 'mp3':\n return 'mp3';\n case 'opus':\n return 'opus';\n case 'flac':\n return 'flac';\n case 'ac3':\n case 'ac-3':\n return 'ac-3';\n case 'pcm_s16le':\n case 'pcm_s32le':\n case 'pcm_f32le':\n return 'pcm-' + normalized.replace('pcm_', '').replace('le', '-le');\n default:\n log(`Unknown audio codec: ${codec}, trying as-is`);\n return codecstring || codec;\n }\n}\n\nfunction configureAudioDecoder(pipeline: PipelineState, description?: Uint8Array): void {\n const track = pipeline.track;\n\n const codec = mapAudioCodec(track.codec, track.codecstring);\n log(`Audio codec mapping: ${track.codec} -> ${codec}`);\n\n const config: AudioDecoderInit = {\n codec,\n sampleRate: track.rate || 48000,\n numberOfChannels: track.channels || 2,\n };\n\n if (description && description.byteLength > 0) {\n config.description = description;\n }\n\n const decoder = new AudioDecoder({\n output: (data: AudioData) => handleDecodedFrame(pipeline, data),\n error: (err: DOMException) => handleDecoderError(pipeline, err),\n });\n\n decoder.configure(config as AudioDecoderConfig);\n pipeline.decoder = decoder;\n\n log(`Audio decoder configured: ${config.codec} ${config.sampleRate}Hz ${config.numberOfChannels}ch`);\n}\n\nfunction handleDecodedFrame(pipeline: PipelineState, frame: VideoFrame | AudioData): void {\n if (pipeline.closed) {\n frame.close();\n return;\n }\n\n const now = performance.now() * 1000; // Convert to microseconds\n const timestamp = frame.timestamp ?? 0;\n\n pipeline.stats.framesDecoded++;\n frameTiming.decoded = now;\n\n // Log first few decoded frames\n if (pipeline.stats.framesDecoded <= 3) {\n const frameType = pipeline.track.type;\n const extraInfo = frameType === 'audio'\n ? ` (${(frame as AudioData).numberOfFrames} samples, ${(frame as AudioData).sampleRate}Hz)`\n : ` (${(frame as VideoFrame).displayWidth}x${(frame as VideoFrame).displayHeight})`;\n log(`Decoded ${frameType} frame ${pipeline.stats.framesDecoded} for track ${pipeline.idx}: ts=${timestamp}μs${extraInfo}`);\n }\n\n // Add to output queue for scheduled release\n pipeline.outputQueue.push({\n frame,\n timestamp,\n decodedAt: performance.now(),\n });\n\n // Try to output frames\n processOutputQueue(pipeline);\n}\n\nfunction handleDecoderError(pipeline: PipelineState, err: DOMException): void {\n log(`Decoder error on track ${pipeline.idx}: ${err.name}: ${err.message}`, 'error');\n log(` Last chunk info: type=${pipeline.stats.lastChunkType}, size=${pipeline.stats.lastChunkSize}, first bytes=[${pipeline.stats.lastChunkBytes}]`, 'error');\n\n // Per rawws.js: reset the pipeline after decoder error\n // This clears queues and recreates the decoder if needed\n resetPipelineAfterError(pipeline);\n\n const message: WorkerToMainMessage = {\n type: 'sendevent',\n kind: 'error',\n message: `Decoder error: ${err.message}`,\n idx: pipeline.idx,\n uid: uidCounter++,\n };\n self.postMessage(message);\n}\n\n/**\n * Reset pipeline after a decoder error\n * Per rawws.js: recreate decoder if closed, otherwise just reset\n */\nfunction resetPipelineAfterError(pipeline: PipelineState): void {\n // Clear queues\n pipeline.inputQueue = [];\n for (const entry of pipeline.outputQueue) {\n entry.frame.close();\n }\n pipeline.outputQueue = [];\n\n // Mark as needing reconfiguration - we'll wait for next keyframe\n pipeline.configured = false;\n\n // If decoder is closed, we need to recreate it (can't reset a closed decoder)\n if (pipeline.decoder && pipeline.decoder.state === 'closed') {\n log(`Decoder closed for track ${pipeline.idx}, will recreate on next configure`);\n pipeline.decoder = null;\n } else if (pipeline.decoder && pipeline.decoder.state !== 'closed') {\n // Try to reset if not closed\n try {\n pipeline.decoder.reset();\n log(`Reset decoder for track ${pipeline.idx}`);\n } catch (e) {\n log(`Failed to reset decoder for track ${pipeline.idx}: ${e}`, 'warn');\n pipeline.decoder = null;\n }\n }\n}\n\n// ============================================================================\n// Frame Input/Output\n// ============================================================================\n\nfunction handleReceive(msg: MainToWorkerMessage & { type: 'receive' }): void {\n const { idx, chunk, uid } = msg;\n const pipeline = pipelines.get(idx);\n\n if (!pipeline) {\n logVerbose(`Received chunk for unknown pipeline ${idx}`);\n return;\n }\n\n if (!pipeline.configured || !pipeline.decoder) {\n // Queue for later\n pipeline.inputQueue.push(chunk);\n logVerbose(`Queued chunk for track ${idx} (configured=${pipeline.configured}, decoder=${!!pipeline.decoder})`);\n return;\n }\n\n // Log only first 3 chunks per track to confirm receiving\n if (pipeline.stats.framesIn < 3) {\n log(`Received chunk ${pipeline.stats.framesIn} for track ${idx}: type=${chunk.type}, ts=${chunk.timestamp / 1000}ms, size=${chunk.data.byteLength}`);\n }\n\n // Check if we need to drop frames due to decoder pressure (Phase 2B)\n if (shouldDropFramesDueToDecoderPressure(pipeline)) {\n if (chunk.type === 'key') {\n // Always accept keyframes - they're needed to resume\n decodeChunk(pipeline, chunk);\n } else {\n // Drop delta frames when decoder is overwhelmed\n pipeline.stats.framesDropped++;\n totalFramesDropped++;\n logVerbose(`Dropped delta frame @ ${chunk.timestamp / 1000}ms (decoder queue: ${pipeline.decoder.decodeQueueSize})`);\n }\n return;\n }\n\n decodeChunk(pipeline, chunk);\n}\n\n/**\n * Check if decoder is under pressure and frames should be dropped\n * Based on Chrome WebCodecs best practices: drop when decodeQueueSize > 2\n */\nfunction shouldDropFramesDueToDecoderPressure(pipeline: PipelineState): boolean {\n if (!pipeline.decoder) return false;\n\n const queueSize = pipeline.decoder.decodeQueueSize;\n pipeline.stats.decoderQueueSize = queueSize;\n\n // Chrome recommendation: drop frames when queue > 2\n return queueSize > MAX_DECODER_QUEUE_SIZE;\n}\n\n/**\n * Drop all frames up to the next keyframe in the input queue\n * Called when decoder is severely backed up\n */\nfunction dropToNextKeyframe(pipeline: PipelineState): number {\n if (pipeline.inputQueue.length === 0) return 0;\n\n // Find next keyframe in queue\n const keyframeIdx = pipeline.inputQueue.findIndex(c => c.type === 'key');\n\n if (keyframeIdx <= 0) {\n // No keyframe or keyframe is first - nothing to drop\n return 0;\n }\n\n // Drop all frames before keyframe\n const dropped = pipeline.inputQueue.splice(0, keyframeIdx);\n pipeline.stats.framesDropped += dropped.length;\n totalFramesDropped += dropped.length;\n\n log(`Dropped ${dropped.length} frames to next keyframe`, 'warn');\n\n return dropped.length;\n}\n\nfunction decodeChunk(\n pipeline: PipelineState,\n chunk: { type: 'key' | 'delta'; timestamp: number; data: Uint8Array }\n): void {\n if (pipeline.closed) return;\n\n const now = performance.now() * 1000;\n frameTiming.in = now;\n pipeline.stats.framesIn++;\n pipeline.stats.lastInputTimestamp = chunk.timestamp;\n\n try {\n // Handle JPEG via ImageDecoder (Phase 2C)\n const codec = pipeline.track.codec;\n if (codec === 'JPEG' || codec.toLowerCase() === 'jpeg') {\n decodeJpegFrame(pipeline, chunk);\n return;\n }\n\n if (!pipeline.decoder) return;\n\n // chunk.timestamp is ALREADY in microseconds (converted by main thread via getPresentationTimestamp)\n const timestampUs = chunk.timestamp;\n\n // Record debug info before decode (for error diagnosis)\n pipeline.stats.lastChunkType = chunk.type;\n pipeline.stats.lastChunkSize = chunk.data.byteLength;\n // Show first 8 bytes to identify format (Annex B starts 0x00 0x00 0x00 0x01, AVCC starts with length)\n const firstBytes = Array.from(chunk.data.slice(0, 8)).map(b => '0x' + b.toString(16).padStart(2, '0')).join(' ');\n pipeline.stats.lastChunkBytes = firstBytes;\n\n if (pipeline.track.type === 'video') {\n // AVCC mode: frames pass through unchanged (decoder has SPS/PPS from description)\n const encodedChunk = new EncodedVideoChunk({\n type: chunk.type,\n timestamp: timestampUs,\n data: chunk.data,\n });\n\n const decoder = pipeline.decoder as VideoDecoder;\n if (pipeline.stats.framesIn <= 3) {\n const firstBytes = Array.from(chunk.data.slice(0, 16)).map(b => '0x' + b.toString(16).padStart(2, '0')).join(' ');\n log(`Calling decode() for track ${pipeline.idx}: state=${decoder.state}, queueSize=${decoder.decodeQueueSize}, chunk type=${chunk.type}, ts=${timestampUs}μs`);\n log(` First 16 bytes: ${firstBytes}`);\n }\n\n decoder.decode(encodedChunk);\n\n if (pipeline.stats.framesIn <= 3) {\n log(`After decode() for track ${pipeline.idx}: queueSize=${decoder.decodeQueueSize}`);\n }\n } else if (pipeline.track.type === 'audio') {\n // Audio chunks are always treated as \"key\" frames - per MistServer rawws.js line 1127\n // Audio codecs don't use inter-frame dependencies like video does\n const encodedChunk = new EncodedAudioChunk({\n type: 'key',\n timestamp: timestampUs,\n data: chunk.data,\n });\n (pipeline.decoder as AudioDecoder).decode(encodedChunk);\n }\n\n // Update decoder queue size (decoder may have been nullified by error callback)\n if (pipeline.decoder) {\n pipeline.stats.decoderQueueSize = pipeline.decoder.decodeQueueSize;\n }\n\n logVerbose(`Decoded chunk ${chunk.type} @ ${chunk.timestamp / 1000}ms for track ${pipeline.idx}`);\n } catch (err) {\n log(`Decode error on track ${pipeline.idx}: ${err}`, 'error');\n }\n}\n\n/**\n * Decode JPEG frame using ImageDecoder API (Phase 2C)\n * ImageDecoder is simpler than VideoDecoder for still images\n */\nasync function decodeJpegFrame(\n pipeline: PipelineState,\n chunk: { type: 'key' | 'delta'; timestamp: number; data: Uint8Array }\n): Promise<void> {\n if (pipeline.closed) return;\n\n // Check if ImageDecoder is available\n if (typeof ImageDecoder === 'undefined') {\n log('ImageDecoder not available - JPEG streams not supported', 'error');\n return;\n }\n\n try {\n // Create ImageDecoder for this frame\n const decoder = new ImageDecoder({\n type: 'image/jpeg',\n data: chunk.data,\n });\n\n // Decode the frame - single decode call per MistServer rawws.js line 1069\n const result = await decoder.decode({ frameIndex: 0 });\n\n // Create VideoFrame from ImageBitmap with the correct timestamp\n const frame = new VideoFrame(result.image, {\n timestamp: chunk.timestamp, // Preserve original timestamp\n });\n\n // Clean up ImageDecoder resources\n result.image.close();\n decoder.close();\n\n // Pass frame through normal output handling\n handleDecodedFrame(pipeline, frame);\n\n logVerbose(`Decoded JPEG frame @ ${chunk.timestamp / 1000}ms for track ${pipeline.idx}`);\n } catch (err) {\n log(`JPEG decode error on track ${pipeline.idx}: ${err}`, 'error');\n }\n}\n\nfunction processOutputQueue(pipeline: PipelineState): void {\n // Check if pipeline is closed (e.g., player destroyed) - clean up queued frames\n if (pipeline.closed) {\n while (pipeline.outputQueue.length > 0) {\n const entry = pipeline.outputQueue.shift()!;\n entry.frame.close();\n }\n return;\n }\n\n if (!pipeline.writer || pipeline.outputQueue.length === 0) {\n if (pipeline.outputQueue.length > 0 && !pipeline.writer) {\n log(`Cannot output: no writer for track ${pipeline.idx} (queue has ${pipeline.outputQueue.length} frames)`, 'warn');\n }\n return;\n }\n\n const now = performance.now();\n\n // Sort output queue by timestamp - MistServer can send frames out of order\n // This is more robust than just swapping adjacent frames\n if (pipeline.outputQueue.length > 1) {\n const wasSorted = pipeline.outputQueue.every((entry, i, arr) =>\n i === 0 || arr[i - 1].timestamp <= entry.timestamp\n );\n if (!wasSorted) {\n pipeline.outputQueue.sort((a, b) => a.timestamp - b.timestamp);\n log(`Sorted ${pipeline.outputQueue.length} frames in output queue for track ${pipeline.idx}`);\n }\n }\n\n // Buffer warmup - wait for buffer to build before starting output to prevent initial jitter\n // With per-track baseTime, each track can start independently once it has enough buffer\n if (!warmupComplete) {\n // Track when warmup started\n if (warmupStartTime === null) {\n warmupStartTime = now;\n log(`Starting buffer warmup (target: ${WARMUP_BUFFER_MS}ms)`);\n }\n\n const elapsed = now - warmupStartTime;\n\n // Calculate buffer from timestamp range in queue\n if (pipeline.outputQueue.length >= 2) {\n const oldest = pipeline.outputQueue[0].timestamp / 1000; // Convert to ms\n const newest = pipeline.outputQueue[pipeline.outputQueue.length - 1].timestamp / 1000;\n const bufferMs = newest - oldest;\n\n // Complete warmup when we have enough buffer OR timeout\n if (bufferMs >= WARMUP_BUFFER_MS || elapsed >= WARMUP_TIMEOUT_MS) {\n warmupComplete = true;\n log(`Buffer warmup complete: ${bufferMs.toFixed(0)}ms buffer, ${pipeline.outputQueue.length} frames queued (track ${pipeline.idx})`);\n } else {\n // Not ready yet - schedule another check\n setTimeout(() => processOutputQueue(pipeline), 10);\n return;\n }\n } else {\n // Not enough frames yet - schedule another check\n if (elapsed >= WARMUP_TIMEOUT_MS) {\n warmupComplete = true;\n log(`Buffer warmup timeout - starting with ${pipeline.outputQueue.length} frame(s) (track ${pipeline.idx})`);\n } else {\n setTimeout(() => processOutputQueue(pipeline), 10);\n return;\n }\n }\n }\n\n // Process all frames that are ready\n while (pipeline.outputQueue.length > 0) {\n const entry = pipeline.outputQueue[0];\n\n // Frame timing (per-track baseTime for A/V with different timestamp bases)\n const schedule = shouldOutputFrame(pipeline, entry, now);\n\n if (!schedule.shouldOutput) {\n // Schedule next check\n if (schedule.checkDelayMs > 0) {\n setTimeout(() => processOutputQueue(pipeline), schedule.checkDelayMs);\n }\n break;\n }\n\n // Output this frame\n pipeline.outputQueue.shift();\n outputFrame(pipeline, entry);\n }\n}\n\nfunction shouldOutputFrame(\n pipeline: PipelineState,\n entry: DecodedFrame,\n now: number\n): { shouldOutput: boolean; earliness: number; checkDelayMs: number } {\n const trackIdx = pipeline.idx;\n\n if (frameTiming.seeking) {\n // During seek, reset baseTime and output first keyframe immediately\n trackBaseTimes.delete(trackIdx);\n return { shouldOutput: true, earliness: 0, checkDelayMs: 0 };\n }\n\n // Frame timestamp in milliseconds (entry.timestamp is in microseconds)\n const frameTimeMs = entry.timestamp / 1000;\n const speed = frameTiming.speed.combined;\n\n // Per-track baseTime to handle different timestamp bases for audio/video\n const baseTime = getTrackBaseTime(trackIdx, frameTimeMs, now);\n\n // Calculate target wall-clock time for this frame (per rawws.js line 872)\n // targetTime = baseTime + frameTimeMs / speed\n const targetTime = baseTime + frameTimeMs / speed;\n\n // How early/late is this frame? Positive = too early, negative = late\n const delay = targetTime - now;\n\n logVerbose(`Frame timing: track=${trackIdx} frame=${frameTimeMs.toFixed(0)}ms, target=${targetTime.toFixed(0)}, now=${now.toFixed(0)}, delay=${delay.toFixed(1)}ms`);\n\n // Output immediately if ready or late (per rawws.js line 889: delay <= 2)\n if (delay <= 2) {\n return { shouldOutput: true, earliness: -delay, checkDelayMs: 0 };\n }\n\n // Schedule check for when frame should be ready\n return { shouldOutput: false, earliness: -delay, checkDelayMs: Math.max(1, Math.floor(delay)) };\n}\n\nfunction outputFrame(pipeline: PipelineState, entry: DecodedFrame): void {\n if (!pipeline.writer || pipeline.closed) {\n entry.frame.close();\n return;\n }\n\n const now = performance.now() * 1000;\n frameTiming.out = now;\n pipeline.stats.framesOut++;\n pipeline.stats.lastOutputTimestamp = entry.timestamp;\n\n // Log first few output frames\n if (pipeline.stats.framesOut <= 3) {\n log(`Output frame ${pipeline.stats.framesOut} for track ${pipeline.idx}: ts=${entry.timestamp}μs`);\n }\n\n // Write returns a Promise - handle rejection to avoid unhandled promise errors\n // Frame ownership is transferred to the stream, so we don't need to close() on success\n pipeline.writer.write(entry.frame).then(() => {\n // Send timeupdate event on successful write\n const message: WorkerToMainMessage = {\n type: 'sendevent',\n kind: 'timeupdate',\n idx: pipeline.idx,\n uid: uidCounter++,\n };\n self.postMessage(message);\n }).catch((err: Error) => {\n // Check for \"stream closed\" errors - these are expected during cleanup\n const errStr = String(err);\n if (errStr.includes('Stream closed') || errStr.includes('InvalidStateError')) {\n // Expected during player cleanup - silently mark pipeline as closed\n pipeline.closed = true;\n } else {\n log(`Failed to write frame: ${err}`, 'error');\n }\n // Frame may not have been consumed by the stream - try to close it\n try {\n entry.frame.close();\n } catch {\n // Frame may already be detached/closed\n }\n });\n}\n\n// ============================================================================\n// Track Generator / Writable Stream\n// ============================================================================\n\nfunction handleSetWritable(msg: MainToWorkerMessage & { type: 'setwritable' }): void {\n const { idx, writable, uid } = msg;\n const pipeline = pipelines.get(idx);\n\n if (!pipeline) {\n log(`Cannot set writable: pipeline ${idx} not found`, 'error');\n sendError(uid, idx, 'Pipeline not found');\n return;\n }\n\n pipeline.writable = writable;\n pipeline.writer = writable.getWriter();\n\n log(`Writable stream set for track ${idx}`);\n\n // Process any queued frames\n processOutputQueue(pipeline);\n\n // Notify main thread track is ready\n const message: WorkerToMainMessage = {\n type: 'addtrack',\n idx,\n uid,\n status: 'ok',\n };\n self.postMessage(message);\n}\n\nfunction handleCreateGenerator(msg: MainToWorkerMessage & { type: 'creategenerator' }): void {\n const { idx, uid } = msg;\n const pipeline = pipelines.get(idx);\n\n if (!pipeline) {\n log(`Cannot create generator: pipeline ${idx} not found`, 'error');\n sendError(uid, idx, 'Pipeline not found');\n return;\n }\n\n // Safari: VideoTrackGenerator is available in worker (not MediaStreamTrackGenerator)\n // Reference: webcodecsworker.js line 852-863\n // @ts-ignore - VideoTrackGenerator may not be in types\n if (typeof VideoTrackGenerator !== 'undefined') {\n if (pipeline.track.type === 'video') {\n // Safari video: use VideoTrackGenerator\n // @ts-ignore\n const generator = new VideoTrackGenerator();\n pipeline.writable = generator.writable;\n pipeline.writer = generator.writable.getWriter();\n\n // Send track back to main thread\n const message: WorkerToMainMessage = {\n type: 'addtrack',\n idx,\n track: generator.track,\n uid,\n status: 'ok',\n };\n // @ts-ignore - transferring MediaStreamTrack\n self.postMessage(message, [generator.track]);\n log(`Created VideoTrackGenerator for track ${idx} (Safari video)`);\n } else if (pipeline.track.type === 'audio') {\n // Safari audio: relay frames to main thread via postMessage\n // Reference: webcodecsworker.js line 773-800\n // Main thread creates the audio generator, we just send frames\n pipeline.writer = {\n write: (frame: AudioData): Promise<void> => {\n return new Promise((resolve, reject) => {\n const frameUid = uidCounter++;\n // Set up listener for response\n const timeoutId = setTimeout(() => {\n reject(new Error('writeframe timeout'));\n }, 5000);\n\n const handler = (e: MessageEvent) => {\n const msg = e.data;\n if (msg.type === 'writeframe' && msg.idx === idx && msg.uid === frameUid) {\n clearTimeout(timeoutId);\n self.removeEventListener('message', handler);\n if (msg.status === 'ok') {\n resolve();\n } else {\n reject(new Error(msg.error || 'writeframe failed'));\n }\n }\n };\n self.addEventListener('message', handler);\n\n // Send frame to main thread\n self.postMessage({\n type: 'writeframe',\n idx,\n frame,\n uid: frameUid,\n }, [frame]);\n });\n },\n close: () => Promise.resolve(),\n } as WritableStreamDefaultWriter<AudioData>;\n\n // Notify main thread to set up audio generator\n const message: WorkerToMainMessage = {\n type: 'addtrack',\n idx,\n uid,\n status: 'ok',\n };\n self.postMessage(message);\n log(`Set up frame relay for track ${idx} (Safari audio)`);\n }\n } else if (typeof MediaStreamTrackGenerator !== 'undefined') {\n // Chrome/Edge: use MediaStreamTrackGenerator in worker\n // @ts-ignore\n const generator = new MediaStreamTrackGenerator({ kind: pipeline.track.type });\n pipeline.writable = generator.writable;\n pipeline.writer = generator.writable.getWriter();\n\n // Send track back to main thread\n const message: WorkerToMainMessage = {\n type: 'addtrack',\n idx,\n track: generator,\n uid,\n status: 'ok',\n };\n // @ts-ignore - transferring MediaStreamTrack\n self.postMessage(message, [generator]);\n log(`Created MediaStreamTrackGenerator for track ${idx}`);\n } else {\n log('Neither VideoTrackGenerator nor MediaStreamTrackGenerator available in worker', 'warn');\n sendError(uid, idx, 'No track generator available');\n }\n}\n\n// ============================================================================\n// Seeking & Timing\n// ============================================================================\n\nfunction handleSeek(msg: MainToWorkerMessage & { type: 'seek' }): void {\n const { seekTime, uid } = msg;\n\n log(`Seek to ${seekTime}ms`);\n frameTiming.seeking = true;\n resetBaseTime(); // Reset timing reference for new position\n\n // Reset warmup state - need to rebuild buffer after seek\n warmupComplete = false;\n warmupStartTime = null;\n\n // Flush all pipeline queues\n for (const pipeline of pipelines.values()) {\n flushPipeline(pipeline);\n }\n\n sendAck(uid);\n}\n\nfunction flushPipeline(pipeline: PipelineState): void {\n // Clear input queue\n pipeline.inputQueue = [];\n\n // Close and clear output queue frames\n for (const entry of pipeline.outputQueue) {\n entry.frame.close();\n }\n pipeline.outputQueue = [];\n\n // Reset decoder if possible\n if (pipeline.decoder && pipeline.decoder.state !== 'closed') {\n try {\n pipeline.decoder.reset();\n } catch {\n // Ignore reset errors\n }\n }\n}\n\nfunction handleFrameTiming(msg: MainToWorkerMessage & { type: 'frametiming' }): void {\n const { action, speed, tweak, uid } = msg;\n\n if (action === 'setSpeed') {\n if (speed !== undefined) frameTiming.speed.main = speed;\n if (tweak !== undefined) frameTiming.speed.tweak = tweak;\n frameTiming.speed.combined = frameTiming.speed.main * frameTiming.speed.tweak;\n log(`Speed set to ${frameTiming.speed.combined} (main: ${frameTiming.speed.main}, tweak: ${frameTiming.speed.tweak})`);\n } else if (action === 'reset') {\n frameTiming.seeking = false;\n log('Frame timing reset (seek complete)');\n }\n\n sendAck(uid);\n}\n\n// ============================================================================\n// Cleanup\n// ============================================================================\n\nfunction handleClose(msg: MainToWorkerMessage & { type: 'close' }): void {\n const { idx, waitEmpty, uid } = msg;\n const pipeline = pipelines.get(idx);\n\n if (!pipeline) {\n sendAck(uid, idx);\n return;\n }\n\n if (waitEmpty && pipeline.outputQueue.length > 0) {\n // Wait for queue to drain\n const checkDrain = () => {\n if (pipeline.outputQueue.length === 0) {\n closePipeline(pipeline, uid);\n } else {\n setTimeout(checkDrain, 10);\n }\n };\n checkDrain();\n } else {\n closePipeline(pipeline, uid);\n }\n}\n\nfunction closePipeline(pipeline: PipelineState, uid: number): void {\n pipeline.closed = true;\n\n // Close decoder\n if (pipeline.decoder && pipeline.decoder.state !== 'closed') {\n try {\n pipeline.decoder.close();\n } catch {\n // Ignore close errors\n }\n }\n\n // Close writer\n if (pipeline.writer) {\n try {\n pipeline.writer.close();\n } catch {\n // Ignore close errors\n }\n }\n\n // Clear queues\n for (const entry of pipeline.outputQueue) {\n entry.frame.close();\n }\n pipeline.outputQueue = [];\n pipeline.inputQueue = [];\n\n // Clean up per-track timing\n trackBaseTimes.delete(pipeline.idx);\n\n pipelines.delete(pipeline.idx);\n\n log(`Closed pipeline ${pipeline.idx}`);\n\n // Stop stats if no more pipelines\n if (pipelines.size === 0 && statsTimer) {\n clearInterval(statsTimer);\n statsTimer = null;\n }\n\n const message: WorkerToMainMessage = {\n type: 'closed',\n idx: pipeline.idx,\n uid,\n status: 'ok',\n };\n self.postMessage(message);\n}\n\n// ============================================================================\n// Stats Reporting\n// ============================================================================\n\nfunction sendStats(): void {\n const pipelineStats: Record<number, PipelineStats> = {};\n\n for (const [idx, pipeline] of pipelines) {\n pipelineStats[idx] = {\n early: null, // Would need frame timing to calculate\n frameDuration: null,\n frames: {\n in: pipeline.stats.framesIn,\n decoded: pipeline.stats.framesDecoded,\n out: pipeline.stats.framesOut,\n },\n queues: {\n in: pipeline.inputQueue.length,\n decoder: pipeline.stats.decoderQueueSize,\n out: pipeline.outputQueue.length,\n },\n timing: {\n decoder: createFrameTrackerStats(),\n writable: createFrameTrackerStats(),\n },\n };\n }\n\n const message: WorkerToMainMessage = {\n type: 'stats',\n stats: {\n frameTiming: {\n in: frameTiming.in,\n decoded: frameTiming.decoded,\n out: frameTiming.out,\n speed: { ...frameTiming.speed },\n seeking: frameTiming.seeking,\n paused: frameTiming.paused,\n },\n pipelines: pipelineStats,\n },\n uid: uidCounter++,\n };\n\n self.postMessage(message);\n}\n\nfunction createFrameTrackerStats(): FrameTrackerStats {\n return {\n lastIn: undefined,\n lastOut: undefined,\n delay: undefined,\n delta: undefined,\n shift: undefined,\n };\n}\n\n// ============================================================================\n// Response Helpers\n// ============================================================================\n\nfunction sendAck(uid: number, idx?: number): void {\n const message: WorkerToMainMessage = {\n type: 'ack',\n uid,\n idx,\n status: 'ok',\n };\n self.postMessage(message);\n}\n\nfunction sendError(uid: number, idx: number | undefined, error: string): void {\n const message: WorkerToMainMessage = {\n type: 'ack',\n uid,\n idx,\n status: 'error',\n error,\n };\n self.postMessage(message);\n}\n\n// ============================================================================\n// Worker Initialization\n// ============================================================================\n\nlog('WebCodecs decoder worker initialized');\n"],"names":[],"mappings":";;;IAAA;;;;;;;;;;;IAWG;IAaH;IACA;IACA;IAEA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyB;IAClD,IAAI,SAAS,GAAwB,KAAK;IAC1C,IAAI,UAAU,GAAG,CAAC;IAElB;IACA,MAAM,WAAW,GAAgB;IAC/B,IAAA,EAAE,EAAE,CAAC;IACL,IAAA,OAAO,EAAE,CAAC;IACV,IAAA,GAAG,EAAE,CAAC;IACN,IAAA,KAAK,EAAE;IACL,QA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ACH,QAAA,MAAM,EAAE,OAAO;YACf,KAAK;SACN;IACD,IAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IAC3B;IAEA;IACA;IACA;IAEA,GAAG,CAAC,sCAAsC,CAAC;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@livepeer-frameworks/player-core",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Core player logic for FrameWorks streaming - framework agnostic",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"style": "dist/player.css",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/esm/index.js",
|
|
17
|
+
"require": "./dist/cjs/index.js",
|
|
18
|
+
"types": "./dist/types/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./vanilla": {
|
|
21
|
+
"import": "./dist/esm/vanilla.js",
|
|
22
|
+
"require": "./dist/cjs/vanilla.js",
|
|
23
|
+
"types": "./dist/types/vanilla/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./player.css": "./dist/player.css",
|
|
26
|
+
"./styles.css": "./dist/player.css"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "pnpm run build:css && NODE_ENV=production rollup -c",
|
|
30
|
+
"build:watch": "NODE_ENV=development rollup -c --watch",
|
|
31
|
+
"build:css": "mkdir -p ./dist && cp ./src/styles/player.css ./dist/player.css",
|
|
32
|
+
"type-check": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"clsx": "^2.1.1",
|
|
36
|
+
"tailwind-merge": "^2.5.2"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"dashjs": "^4.0.0 || ^5.0.0",
|
|
40
|
+
"hls.js": "^1.0.0",
|
|
41
|
+
"video.js": "^8.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"dashjs": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"hls.js": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"video.js": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
57
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
58
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
59
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
60
|
+
"@tailwindcss/postcss": "^4.1.14",
|
|
61
|
+
"autoprefixer": "^10.4.20",
|
|
62
|
+
"postcss": "^8.4.47",
|
|
63
|
+
"postcss-cli": "^11.0.1",
|
|
64
|
+
"postcss-prefix-selector": "^2.1.1",
|
|
65
|
+
"rollup": "^4.48.1",
|
|
66
|
+
"tailwindcss": "^4.1.14",
|
|
67
|
+
"tslib": "^2.8.1",
|
|
68
|
+
"typescript": "^5.9.2"
|
|
69
|
+
},
|
|
70
|
+
"keywords": [
|
|
71
|
+
"streaming",
|
|
72
|
+
"mistserver",
|
|
73
|
+
"webrtc",
|
|
74
|
+
"player",
|
|
75
|
+
"hls",
|
|
76
|
+
"dash"
|
|
77
|
+
],
|
|
78
|
+
"author": "Livepeer FrameWorks",
|
|
79
|
+
"license": "Unlicense"
|
|
80
|
+
}
|