@remotion/media-utils 4.0.0-fastlambda.8 → 4.0.0-offthread.21
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/get-audio-data.js
CHANGED
|
@@ -28,6 +28,9 @@ const fn = async (src) => {
|
|
|
28
28
|
if (metadataCache[src]) {
|
|
29
29
|
return metadataCache[src];
|
|
30
30
|
}
|
|
31
|
+
if (typeof document === 'undefined') {
|
|
32
|
+
throw new Error('getAudioData() is only available in the browser.');
|
|
33
|
+
}
|
|
31
34
|
const audioContext = new AudioContext();
|
|
32
35
|
const response = await fetchWithCorsCatch(src);
|
|
33
36
|
const arrayBuffer = await response.arrayBuffer();
|
|
@@ -8,6 +8,9 @@ const fn = (src) => {
|
|
|
8
8
|
if (metadataCache[src]) {
|
|
9
9
|
return Promise.resolve(metadataCache[src]);
|
|
10
10
|
}
|
|
11
|
+
if (typeof document === 'undefined') {
|
|
12
|
+
throw new Error('getAudioDuration() is only available in the browser.');
|
|
13
|
+
}
|
|
11
14
|
const audio = document.createElement('audio');
|
|
12
15
|
audio.src = src;
|
|
13
16
|
return new Promise((resolve, reject) => {
|
|
@@ -9,6 +9,9 @@ const fn = (src) => {
|
|
|
9
9
|
if (cache[src]) {
|
|
10
10
|
return Promise.resolve(cache[src]);
|
|
11
11
|
}
|
|
12
|
+
if (typeof document === 'undefined') {
|
|
13
|
+
throw new Error('getVideoMetadata() is only available in the browser.');
|
|
14
|
+
}
|
|
12
15
|
const video = document.createElement('video');
|
|
13
16
|
video.src = src;
|
|
14
17
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/media-utils",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-offthread.21+1965d2596",
|
|
4
4
|
"description": "Utility functions for audio and video",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"remotion": "4.0.0-
|
|
21
|
+
"remotion": "4.0.0-offthread.21+1965d2596"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "1965d2596493ada30f25a823ee3d85de7325c341"
|
|
48
48
|
}
|