🎥 Make videos programmatically with React
update docs
Jonny Burger7bc5e418ad4f
diff --git a/packages/docs/docs/media-parser/fast-and-slow.mdx b/packages/docs/docs/media-parser/fast-and-slow.mdxindex 10596477d2..4a33c0e362 100644--- a/packages/docs/docs/media-parser/fast-and-slow.mdx+++ b/packages/docs/docs/media-parser/fast-and-slow.mdx@@ -26,6 +26,8 @@ The following [`fields`](/docs/media-parser#fields) require the full file to be- [`slowFps`](/docs/media-parser/parse-media#slowfps)- [`slowDurationInSeconds`](/docs/media-parser/parse-media#slowdurationinseconds)- [`slowNumberOfFrames`](/docs/media-parser/parse-media#slownumberofframes)+- [`metadata`](/docs/media-parser/parse-media#metadata)+- [`images`](/docs/media-parser/parse-media#images)Also, if an [`onVideoTrack`](/docs/media-parser/parse-media#onvideotrack) or [`onAudioTrack`](/docs/media-parser/parse-media#onvideotrack) handler is passed, and the handler function returns an callback function for each sample, full parsing is required.@@ -44,7 +46,6 @@ The following [`fields`](/docs/media-parser#fields) require only the metadata se- [`unrotatedDimensions`](/docs/media-parser/parse-media#unrotateddimensions)- [`isHdr`](/docs/media-parser/parse-media#ishdr)- [`rotation`](/docs/media-parser/parse-media#rotation)-- [`metadata`](/docs/media-parser/parse-media#metadata)- [`location`](/docs/media-parser/parse-media#location)- [`keyframes`](/docs/media-parser/parse-media#keyframes)diff --git a/packages/docs/docs/media-parser/foreign-file-types.mdx b/packages/docs/docs/media-parser/foreign-file-types.mdxindex 739a240404..611a3eee67 100644--- a/packages/docs/docs/media-parser/foreign-file-types.mdx+++ b/packages/docs/docs/media-parser/foreign-file-types.mdx@@ -14,14 +14,7 @@ This is useful if you allow users to upload an arbitrary file and want to get in```tsx twoslash title="Get information about a video, or get the file type if it's not a video"// @module: es2022// @target: es2017-import {- parseMedia,- IsAnImageError,- IsAGifError,- IsAPdfError,- IsAnUnsupportedFileTypeError,- IsAnUnsupportedAudioTypeError,-} from '@remotion/media-parser';+import {parseMedia, IsAnImageError, IsAGifError, IsAPdfError, IsAnUnsupportedFileTypeError, IsAnUnsupportedAudioTypeError} from '@remotion/media-parser';try {await parseMedia({@@ -30,12 +23,7 @@ try {});} catch (e) {if (e instanceof IsAnImageError) {- console.log(- 'The file is an image of format:',- e.imageType,- 'dimensions:',- e.dimensions,- );+ console.log('The file is an image of format:', e.imageType, 'dimensions:', e.dimensions);} else if (e instanceof IsAGifError) {console.log('The file is a GIF');} else if (e instanceof IsAPdfError) {@@ -67,10 +55,11 @@ An error if the file is an audio file that `@remotion/media-parser` does not yet- `fileName`: The name of the file - from file name or `Content-Disposition` header.- `sizeInBytes`: The size of the file in bytes.- `mimeType`: The MIME type of the file.-- `audioType`: The type of the audio file - one of `mp3`, `wav` and `aac`.+- `audioType`: The type of the audio file - one of `wav` or `aac`.:::note-`@remotion/media-parser` aims to support these audio formats in the future, in which case they will not throw an error but return audio tracks.+`.mp3` is supported and will not throw an error.+`@remotion/media-parser` aims to support other audio formats in the future, in which case they will not throw an error but return audio tracks.:::### `IsAGifError`diff --git a/packages/docs/docs/media-parser/index.mdx b/packages/docs/docs/media-parser/index.mdxindex 3135be38e8..3846fcfc72 100644--- a/packages/docs/docs/media-parser/index.mdx+++ b/packages/docs/docs/media-parser/index.mdx@@ -6,10 +6,7 @@ title: '@remotion/media-parser'import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem';-import {- TableOfContents,- MediaParserGuideTableOfContents,-} from './TableOfContents';+import {TableOfContents, MediaParserGuideTableOfContents} from './TableOfContents';_available from v4.0.190_@@ -21,7 +18,7 @@ This is an experimental package that parses video and other media files in orderDesign goals:-- Support as many relevant containers as possible - currently: `.mp4`, `.mov`, `.webm`, `.mkv`, `.avi`, `.ts`+- Support as many relevant containers as possible - currently: `.mp4`, `.mov`, `.webm`, `.mkv`, `.avi`, `.ts`, `.mp3`- [Work in the browser, and server runtimes (Node.js, Bun, Edge, etc.)](/docs/media-parser/support)- [Enable powerful WebCodecs use cases](/docs/media-parser/webcodecs)- [Fine-grained querying, only download as much data as necessary](/docs/media-parser/fast-and-slow)diff --git a/packages/docs/docs/media-parser/parse-media.mdx b/packages/docs/docs/media-parser/parse-media.mdxindex 2e8dc9db50..e55e5b5eaf 100644--- a/packages/docs/docs/media-parser/parse-media.mdx+++ b/packages/docs/docs/media-parser/parse-media.mdx@@ -211,6 +211,17 @@ _number_The rotation of the video in degrees (e.g. `-90` for a 90° counter-clockwise rotation).+#### `images`++Return type: <TsType type="MediaParserEmbeddedImage[]" source="@remotion/media-parser" />++Embedded images in the file, for example an album cover inside an MP3.+Each array element has the following fields:++- `mimeType`: The MIME type of the image, or `null`+- `description`: A description of the image, or `null`+- `data`: The image data as a `Uint8Array`+### `reader?`A reader interface.