Skip to content

🎥 Make videos programmatically with React

tweak GIF readme page and docs

Jonny Burger2712091316d2
diff --git a/packages/docs/docs/gif.md b/packages/docs/docs/gif.md
index 54fa5ce44b..27dd49cc4f 100644
--- a/packages/docs/docs/gif.md
+++ b/packages/docs/docs/gif.md
@@ -18,6 +18,8 @@ _required_
The source of the GIF. Can be an URL or a local image - see [Importing assets](/docs/assets).
+> If you pass a remote URL, it must be [CORS-enabled](https://enable-cors.org/).
+
### `width`
The display width.
diff --git a/packages/docs/docs/importing-assets.md b/packages/docs/docs/importing-assets.md
index d6650dd239..9d808c2da8 100644
--- a/packages/docs/docs/importing-assets.md
+++ b/packages/docs/docs/importing-assets.md
@@ -6,7 +6,7 @@ title: Importing assets
Remotion allows you to include several types of files in your project:
- Images (`.png`, `.svg`, `.jpg`, `.jpeg`, `.webp`, `.gif`, `.bmp`)
-- Videos (`.webm`, `.mp4`)
+- Videos (`.webm`, `.mov`, `.mp4`)
- Audio (`.mp3`, `.wav`, `.aac`)
- [Webfonts - read the separate page for fonts](/docs/fonts)
- Arbitrary files using the `staticFile()` API
diff --git a/packages/gif/README.md b/packages/gif/README.md
index ede1bacc10..ee6f68272d 100644
--- a/packages/gif/README.md
+++ b/packages/gif/README.md
@@ -1,35 +1,35 @@
### Remotion GIF
-[![NPM Version](http://img.shields.io/npm/v/@remotion/player.svg?style=flat)](https://www.npmjs.org/package/@remotion/player)
+[![NPM Version](https://img.shields.io/npm/v/@remotion/player.svg?style=flat)](https://www.npmjs.org/package/@remotion/player)
[![NPM Downloads](https://img.shields.io/npm/dm/@remotion/player.svg?style=flat)](https://npmcharts.com/compare/@remotion/player?minimal=true)
[![Install Size](https://packagephobia.now.sh/badge?p=@remotion/player)](https://packagephobia.now.sh/result?p=@remotion/player)
-To use this package, we'll be assuming you already have the required setup to use Remotion. The dependencies that Remotion requires you to have pre-installed on your machine are Node.js and FFMPEG. You can take a look at this [guide](https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg) on how to get FFMPEG on your machine.
+The Remotion GIF package allows you to embed GIFs into a [Remotion](https://remotion.dev) composition that synchronizes with Remotion's `useCurrentFrame()`'s hook.
-The Remotion gif package allows you to create a React component for displaying GIFs that synchronizes with Remotion's `useCurrentFrame()`'s hook.
+To use this package, we'll be assuming [you already have a Remotion project](https://remotion.dev/docs).
-You can read more about the hook [here](https://www.remotion.dev/docs/use-current-frame)
+Use the same package manager to install this package that you have used to initialize your Remotion project:
-You can get this package with the commands below, depending on the type of package manager that you are comfortable with.
-
-- npm
```bash
-npm install @remotion/gif
+npm i @remotion/gif
```
-- yarn
+
```bash
yarn add @remotion/gif
```
-- pnpm
+
```bash
-pnpm install @remotion/player
+pnpm i @remotion/gif
```
-### remotion/gif in action
+> Make sure all Remotion packages you install (`remotion`, `@remotion/player`, `@remotion/gif`...) [have the same version](https://remotion.dev/docs/version-mismatch).
+
+### Basic Example
-The `player` package can be imported as a React component from the library, which you can make use of in your components, either by nesting it in a custom component of yours or simply making it a standalone component.
+This will render a GIF that fills the whole size of the composition:
```javascript
+import { useVideoConfig } from "remotion";
import { Gif } from "@remotion/gif";
 
export const MyComponent = () => {
@@ -46,13 +46,13 @@ export const MyComponent = () => {
};
```
-### The remotion/gif props
+### API
-Props | Function |
+Prop | Function |
--- | --- |
-src | is a required prop, and it is the source of the GIF. It Can be a URL or a local image - [See how you can import assets](https://www.remotion.dev/docs/assets).|
+src | is a required prop, and it is the source of the GIF. It can be a URL or a local image - [See how you can import assets](https://www.remotion.dev/docs/assets).|
width | The display width of the GIF
height | The display height of the GIF
fill | The layout of the GIF in its current container. It accepts the following values: `fill`, `contain`, and `cover`
-For a complete reference of the available props, refer to [@remotion/gif API](https://www.remotion.dev/docs/gif).
+For a complete reference of the available props, refer to [the @remotion/gif documentation](https://www.remotion.dev/docs/gif).