@remotion/media 4.0.393 → 4.0.394

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.
@@ -38,17 +38,17 @@ const extractAudioInternal = async ({ src, timeInSeconds: unloopedTimeInSeconds,
38
38
  if (timeInSeconds === null) {
39
39
  return { data: null, durationInSeconds: mediaDurationInSeconds };
40
40
  }
41
- const sampleIterator = await audioManager.getIterator({
42
- src,
43
- timeInSeconds,
44
- audioSampleSink: audio.sampleSink,
45
- isMatroska,
46
- actualMatroskaTimestamps,
47
- logLevel,
48
- maxCacheSize,
49
- });
50
- const durationInSeconds = durationNotYetApplyingPlaybackRate * playbackRate;
51
41
  try {
42
+ const sampleIterator = await audioManager.getIterator({
43
+ src,
44
+ timeInSeconds,
45
+ audioSampleSink: audio.sampleSink,
46
+ isMatroska,
47
+ actualMatroskaTimestamps,
48
+ logLevel,
49
+ maxCacheSize,
50
+ });
51
+ const durationInSeconds = durationNotYetApplyingPlaybackRate * playbackRate;
52
52
  const samples = await sampleIterator.getSamples(timeInSeconds, durationInSeconds);
53
53
  audioManager.logOpenFrames();
54
54
  const audioDataArray = [];
@@ -3085,17 +3085,17 @@ var extractAudioInternal = async ({
3085
3085
  if (timeInSeconds === null) {
3086
3086
  return { data: null, durationInSeconds: mediaDurationInSeconds };
3087
3087
  }
3088
- const sampleIterator = await audioManager.getIterator({
3089
- src,
3090
- timeInSeconds,
3091
- audioSampleSink: audio.sampleSink,
3092
- isMatroska,
3093
- actualMatroskaTimestamps,
3094
- logLevel,
3095
- maxCacheSize
3096
- });
3097
- const durationInSeconds = durationNotYetApplyingPlaybackRate * playbackRate;
3098
3088
  try {
3089
+ const sampleIterator = await audioManager.getIterator({
3090
+ src,
3091
+ timeInSeconds,
3092
+ audioSampleSink: audio.sampleSink,
3093
+ isMatroska,
3094
+ actualMatroskaTimestamps,
3095
+ logLevel,
3096
+ maxCacheSize
3097
+ });
3098
+ const durationInSeconds = durationNotYetApplyingPlaybackRate * playbackRate;
3099
3099
  const samples = await sampleIterator.getSamples(timeInSeconds, durationInSeconds);
3100
3100
  audioManager.logOpenFrames();
3101
3101
  const audioDataArray = [];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Utility to check if error is network error
3
+ * @param error
4
+ * @returns
5
+ */
6
+ export declare function isNetworkError(error: Error): boolean;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Utility to check if error is network error
3
+ * @param error
4
+ * @returns
5
+ */
6
+ export function isNetworkError(error) {
7
+ if (
8
+ // Chrome
9
+ error.message.includes('Failed to fetch') ||
10
+ // Safari
11
+ error.message.includes('Load failed') ||
12
+ // Firefox
13
+ error.message.includes('NetworkError when attempting to fetch resource')) {
14
+ return true;
15
+ }
16
+ return false;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.393",
3
+ "version": "4.0.394",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "mediabunny": "1.27.0",
25
- "remotion": "4.0.393"
25
+ "remotion": "4.0.394"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.8.0",
29
29
  "react-dom": ">=16.8.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@remotion/eslint-config-internal": "4.0.393",
32
+ "@remotion/eslint-config-internal": "4.0.394",
33
33
  "@vitest/browser-webdriverio": "4.0.9",
34
34
  "eslint": "9.19.0",
35
35
  "react": "19.2.3",