Update website

This commit is contained in:
Jerome Wu
2023-07-24 23:57:29 +08:00
parent b277631f38
commit 8a9ffadf85
11 changed files with 88 additions and 17 deletions

View File

@@ -1,44 +1,67 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Installation
ffmpeg.wasm supports multiple ways of installation:
:::note
ffmpeg.wasm only supports running in browser, see [FAQ](/docs/faq) for more
details
:::
## Packages Managers
To install ffmpeg.wasm using package managers like npm and yarn:
Install ffmpeg.wasm using package managers like npm and yarn:
<Tabs>
<TabItem value="npm" label="npm" default>
```bash
npm install @ffmpeg/ffmpeg
npm install @ffmpeg/ffmpeg @ffmpeg/util
```
Or
</TabItem>
<TabItem value="yarn" label="yarn">
```bash
yarn add @ffmpeg/ffmpeg
yarn add @ffmpeg/ffmpeg @ffmpeg/util
```
## Vanilla HTML
</TabItem>
</Tabs>
To use ffmpeg.wasm directly in your web page:
## CDN
Install ffmpeg.wasm with minimal setup via installing it via CDN.
<Tabs>
<TabItem value="classic" label="classic" default>
```html
<html>
<head>
<script src="https://unpkg.com/@ffmpeg/ffmpeg@0.12.0/dist/umd/ffmpeg.js"></script>
<script src="https://unpkg.com/@ffmpeg/util@0.12.0/dist/umd/index.js"></script>
<script>
const { FFmpeg } = FFmpegWASM;
const { fetchFile } = FFmpegUtil;
</script>
</head>
</html>
```
Or use it as a module:
</TabItem>
<TabItem value="module" label="module">
```html
<html>
<head>
<script type="module">
import { FFmpeg } from "https://unpkg.com/@ffmpeg/ffmpeg@0.12.0/dist/esm/ffmpeg.js";
import { fetchFile } from "https://unpkg.com/@ffmpeg/util@0.12.0/dist/esm/index.js";
</script>
</head>
</html>
```
</TabItem>
</Tabs>