docs: update installation

This commit is contained in:
Jerome Wu 2023-01-18 22:12:30 +08:00
parent b6f59852ed
commit 2cd16a9d22

View File

@ -1 +1,44 @@
# Installation
ffmpeg.wasm supports multiple ways of installation:
## Packages Managers
To install ffmpeg.wasm using package managers like npm and yarn:
```bash
npm install @ffmpeg/ffmpeg
```
Or
```bash
yarn add @ffmpeg/ffmpeg
```
## Vanilla HTML
To use ffmpeg.wasm directly in your web page:
```html
<html>
<head>
<script src="https://unpkg.com/@ffmpeg/ffmpeg@0.12.0/dist/umd/ffmpeg.js"></script>
<script>
const { FFmpeg } = FFmpegWASM;
</script>
</head>
</html>
```
Or use it as a module:
```html
<html>
<head>
<script type="module">
import { FFmpeg } from "https://unpkg.com/@ffmpeg/ffmpeg@0.12.0/dist/esm/ffmpeg.js";
</script>
</head>
</html>
```