@onesy/ui-react 1.0.27 → 1.0.28
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/esm/index.js +1 -1
- package/esm/utils.js +3 -3
- package/package.json +1 -1
- package/utils.js +3 -3
package/esm/index.js
CHANGED
package/esm/utils.js
CHANGED
@@ -1269,9 +1269,9 @@ export const audioFix = async (blob, duration) => {
|
|
1269
1269
|
}
|
1270
1270
|
|
1271
1271
|
// WebM duration EBML ID: 0x4489 (Segment Information -> Duration)
|
1272
|
-
const durationPos = findElement(
|
1272
|
+
const durationPos = findElement('4489');
|
1273
1273
|
if (durationPos === -1) {
|
1274
|
-
throw new Error(
|
1274
|
+
throw new Error('Duration element not found in the WebM file.');
|
1275
1275
|
}
|
1276
1276
|
|
1277
1277
|
// Encode new duration in IEEE 754 Float64 (Big Endian, 8 bytes)
|
@@ -1282,7 +1282,7 @@ export const audioFix = async (blob, duration) => {
|
|
1282
1282
|
|
1283
1283
|
// Convert back to Blob
|
1284
1284
|
const blobUpdated = new Blob([uint8Array], {
|
1285
|
-
type:
|
1285
|
+
type: 'audio/webm'
|
1286
1286
|
});
|
1287
1287
|
return {
|
1288
1288
|
blob: blobUpdated,
|
package/package.json
CHANGED
package/utils.js
CHANGED
@@ -1434,16 +1434,16 @@ const audioFix = async (blob, duration) => {
|
|
1434
1434
|
return -1;
|
1435
1435
|
}
|
1436
1436
|
// WebM duration EBML ID: 0x4489 (Segment Information -> Duration)
|
1437
|
-
const durationPos = findElement(
|
1437
|
+
const durationPos = findElement('4489');
|
1438
1438
|
if (durationPos === -1) {
|
1439
|
-
throw new Error(
|
1439
|
+
throw new Error('Duration element not found in the WebM file.');
|
1440
1440
|
}
|
1441
1441
|
// Encode new duration in IEEE 754 Float64 (Big Endian, 8 bytes)
|
1442
1442
|
const durationBytes = new Uint8Array(new Float64Array([duration]).buffer).reverse();
|
1443
1443
|
// Overwrite duration bytes in the WebM file
|
1444
1444
|
uint8Array.set(durationBytes, durationPos);
|
1445
1445
|
// Convert back to Blob
|
1446
|
-
const blobUpdated = new Blob([uint8Array], { type:
|
1446
|
+
const blobUpdated = new Blob([uint8Array], { type: 'audio/webm' });
|
1447
1447
|
return {
|
1448
1448
|
blob: blobUpdated,
|
1449
1449
|
duration
|