Skip to content

🎥 Make videos programmatically with React

better docs and help link for media playback error

Jonny Burger34e6bab3c861
diff --git a/packages/cli/src/preview-server/error-overlay/remotion-overlay/get-help-link.ts b/packages/cli/src/preview-server/error-overlay/remotion-overlay/get-help-link.ts
index 6ddff7d1a5..05a1df123f 100644
--- a/packages/cli/src/preview-server/error-overlay/remotion-overlay/get-help-link.ts
+++ b/packages/cli/src/preview-server/error-overlay/remotion-overlay/get-help-link.ts
@@ -43,5 +43,12 @@ export const getHelpLink = (message: string): THelpLink | null => {
};
}
+ if (message.includes('https://remotion.dev/docs/media-playback-error')) {
+ return {
+ title: 'Media playback error',
+ url: 'https://remotion.dev/docs/media-playback-error',
+ };
+ }
+
return null;
};
diff --git a/packages/docs/docs/media-playback-error.md b/packages/docs/docs/media-playback-error.md
index 6ebf05f7d7..ab0ce8b212 100644
--- a/packages/docs/docs/media-playback-error.md
+++ b/packages/docs/docs/media-playback-error.md
@@ -7,13 +7,13 @@ sidebar_label: Media playback error
The following error may occur in your Remotion project during development or while rendering:
```diff
-- Error: Could not play video with src [source]
+- Error: Could not play video with src [source] [object MediaError]
```
or
```diff
-- Error: Could not play audio with src [source]
+- Error: Could not play audio with src [source] [object MediaError]
```
This error happens when you are trying to embed a `<Video/>` or `<Audio/>` tag in your Remotion project but the browser is unable to load and play the media. Although the browser does not report the exact error, there are two common reasons for this error.
@@ -22,11 +22,25 @@ This error happens when you are trying to embed a `<Video/>` or `<Audio/>` tag i
Unlike Google Chrome, the Chromium Browser does not include proprietary codecs. This means you cannot play MP4/H.264 videos and some audio codecs (more codecs may not be supported).
-**Workaround**: Convert videos to WebM or [use Chrome instead of Chromium](/docs/config#setbrowserexecutable).
+**Workaround**: Convert videos to WebM, [use Chrome instead of Chromium](/docs/config#setbrowserexecutable), or use [`<OffthreadVideo>`](/docs/offthreadvideo).
## Invalid source
-Make sure you are trying to load a video that is either available locally or publicly on the internet. Typing the `src` prop will lead to this error.
+Make sure you are trying to load a video that is either available locally or publicly on the internet. Open the DevTools, go to the Network tab, track the asset being loaded, and open it in a new tab. Does it actually start playing?
+
+## Wrong headers or status code
+
+In order for the browser being able to play the media, it should be loaded with:
+
+- a 200 status code
+- a suitable `Content-Type` header
+- A `Content-Range` header in order to support seeking.
+
+Open the DevTools and go to the network tab to validate that this is the case.
+
+## Internet Download Manager
+
+[Internet Download Manager](https://www.internetdownloadmanager.com/) is known to manipulate the network traffic causing problems for the browser to load media. Disable it if you have it.
## Other unsupported codecs