diff --git a/src/sample.ts b/src/sample.ts index 2ccf78d..b59b332 100644 --- a/src/sample.ts +++ b/src/sample.ts @@ -143,8 +143,11 @@ export class VideoSample { this._data = data; this.format = data.format; - this.codedWidth = data.codedWidth; - this.codedHeight = data.codedHeight; + // Copying the display dimensions here, assuming no innate VideoFrame rotation + this.codedWidth = data.displayWidth; + this.codedHeight = data.displayHeight; + // The VideoFrame's rotation is ignored here. It's still a new field, and I'm not sure of any application + // where the browser makes use of it. If a case gets found, I'll add it. this.rotation = init?.rotation ?? 0; this.timestamp = init?.timestamp ?? data.timestamp / 1e6; this.duration = init?.duration ?? (data.duration ?? 0) / 1e6; diff --git a/src/source.ts b/src/source.ts index 10f1f28..d0c2e00 100644 --- a/src/source.ts +++ b/src/source.ts @@ -491,7 +491,7 @@ export class FilePathSource extends Source { this._streamSource = new StreamSource({ getSize: async () => { const FS_MODULE_NAME = 'node:fs/promises'; - const fs = await import(FS_MODULE_NAME) as typeof import('node:fs/promises'); + const fs = await import(/* @vite-ignore */ FS_MODULE_NAME) as typeof import('node:fs/promises'); fileHandle = await fs.open(filePath, 'r'); const stats = await fileHandle.stat();