Fix discarded rotation when doing VideoSample.clone()

This commit is contained in:
Vanilagy
2025-07-28 01:50:39 +02:00
parent ef3b53ff8a
commit 72ed933bf4
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "mediabunny", "name": "mediabunny",
"version": "1.4.1", "version": "1.4.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mediabunny", "name": "mediabunny",
"version": "1.4.1", "version": "1.4.2",
"license": "MPL-2.0", "license": "MPL-2.0",
"dependencies": { "dependencies": {
"@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-mediacapture-transform": "^0.1.11",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "mediabunny", "name": "mediabunny",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.4.1", "version": "1.4.2",
"description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.", "description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.",
"type": "module", "type": "module",
"main": "./dist/bundles/mediabunny.cjs", "main": "./dist/bundles/mediabunny.cjs",
+3
View File
@@ -236,6 +236,7 @@ export class VideoSample {
return new VideoSample(this._data.clone(), { return new VideoSample(this._data.clone(), {
timestamp: this.timestamp, timestamp: this.timestamp,
duration: this.duration, duration: this.duration,
rotation: this.rotation,
}); });
} else if (this._data instanceof Uint8Array) { } else if (this._data instanceof Uint8Array) {
return new VideoSample(this._data.slice(), { return new VideoSample(this._data.slice(), {
@@ -245,6 +246,7 @@ export class VideoSample {
timestamp: this.timestamp, timestamp: this.timestamp,
duration: this.duration, duration: this.duration,
colorSpace: this.colorSpace, colorSpace: this.colorSpace,
rotation: this.rotation,
}); });
} else { } else {
return new VideoSample(this._data, { return new VideoSample(this._data, {
@@ -254,6 +256,7 @@ export class VideoSample {
timestamp: this.timestamp, timestamp: this.timestamp,
duration: this.duration, duration: this.duration,
colorSpace: this.colorSpace, colorSpace: this.colorSpace,
rotation: this.rotation,
}); });
} }
} }