Skip to content

Commit 14a9f61

Browse files
committed
fix: replace unpkg w/ jsdelivr
1 parent 63ea4cc commit 14a9f61

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

apps/angular-app/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RouterOutlet } from '@angular/router';
44
import { FFmpeg } from '@ffmpeg/ffmpeg';
55
import { fetchFile, toBlobURL } from '@ffmpeg/util';
66

7-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/esm';
7+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm';
88

99
@Component({
1010
selector: 'app-root',

apps/nextjs-app/app/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function Home() {
1313

1414
const load = async () => {
1515
setIsLoading(true);
16-
const baseURL = "https://unpkg.com/@ffmpeg/[email protected]/dist/umd";
16+
const baseURL = "https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd";
1717
const ffmpeg = ffmpegRef.current;
1818
ffmpeg.on("log", ({ message }) => {
1919
if (messageRef.current) messageRef.current.innerHTML = message;

apps/react-vite-app/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function App() {
99
const messageRef = useRef<HTMLParagraphElement | null>(null);
1010

1111
const load = async () => {
12-
const baseURL = "https://unpkg.com/@ffmpeg/[email protected]/dist/esm";
12+
const baseURL = "https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm";
1313
const ffmpeg = ffmpegRef.current;
1414
ffmpeg.on("log", ({ message }) => {
1515
if (messageRef.current) messageRef.current.innerHTML = message;

apps/solidstart-app/src/routes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FFmpeg } from '@ffmpeg/ffmpeg';
22
import { fetchFile, toBlobURL } from '@ffmpeg/util';
33
import { createSignal, Show } from 'solid-js';
44

5-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/esm';
5+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm';
66
const videoURL =
77
'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi';
88

apps/sveltekit-app/src/lib/FFmpegDemo.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
let videoEl: HTMLVideoElement;
88
9-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/esm';
9+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm';
1010
const videoURL = 'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi';
1111
1212
let message = 'Click Start to Transcode';

apps/website/docs/getting-started/usage.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is recommended to read [Overview](/docs/overview) first.
1111
:::caution
1212
If you are a [vite](https://vitejs.dev/) user, use `esm` in **baseURL** instead of `umd`:
1313

14-
~~https://unpkg.com/@ffmpeg/[email protected]/dist/umd~~ => https://unpkg.com/@ffmpeg/[email protected]/dist/esm
14+
~~https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd~~ => https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm
1515
:::
1616

1717
```jsx live
@@ -24,7 +24,7 @@ function() {
2424
const messageRef = useRef(null);
2525

2626
const load = async () => {
27-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
27+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
2828
const ffmpeg = ffmpegRef.current;
2929
ffmpeg.on('log', ({ message }) => {
3030
messageRef.current.innerHTML = message;
@@ -81,7 +81,7 @@ function() {
8181
const messageRef = useRef(null);
8282

8383
const load = async () => {
84-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
84+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
8585
const ffmpeg = ffmpegRef.current;
8686
ffmpeg.on('log', ({ message }) => {
8787
messageRef.current.innerHTML = message;
@@ -134,7 +134,7 @@ function() {
134134
const messageRef = useRef(null);
135135

136136
const load = async () => {
137-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
137+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
138138
const ffmpeg = ffmpegRef.current;
139139
ffmpeg.on('log', ({ message }) => {
140140
messageRef.current.innerHTML = message;
@@ -192,7 +192,7 @@ function() {
192192
const messageRef = useRef(null);
193193

194194
const load = async () => {
195-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
195+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
196196
const ffmpeg = ffmpegRef.current;
197197
// Listen to progress event instead of log.
198198
ffmpeg.on('progress', ({ progress, time }) => {
@@ -243,7 +243,7 @@ function() {
243243
const messageRef = useRef(null);
244244

245245
const load = async () => {
246-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
246+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
247247
const ffmpeg = ffmpegRef.current;
248248
ffmpeg.on('log', ({ message }) => {
249249
messageRef.current.innerHTML = message;
@@ -313,7 +313,7 @@ function() {
313313
const messageRef = useRef(null);
314314

315315
const load = async () => {
316-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
316+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
317317
const ffmpeg = ffmpegRef.current;
318318
ffmpeg.on('log', ({ message }) => {
319319
messageRef.current.innerHTML = message;
@@ -372,7 +372,7 @@ function() {
372372
const messageRef = useRef(null);
373373

374374
const load = async () => {
375-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/umd'
375+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd'
376376
const ffmpeg = ffmpegRef.current;
377377
ffmpeg.on('log', ({ message }) => {
378378
messageRef.current.innerHTML = message;

apps/website/src/components/Playground/const.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export const CORE_VERSION = "0.12.6";
22

3-
export const CORE_URL = `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
4-
export const CORE_MT_URL = `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
3+
export const CORE_URL = `https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
4+
export const CORE_MT_URL = `https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
55

66
export const CORE_SIZE = {
7-
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 114673,
8-
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32129114,
9-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 132680,
10-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32609891,
11-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2915,
7+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 114673,
8+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32129114,
9+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 132680,
10+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32609891,
11+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2915,
1212
};
1313

1414
export const SAMPLE_FILES = {

packages/ffmpeg/src/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const MIME_TYPE_JAVASCRIPT = "text/javascript";
22
export const MIME_TYPE_WASM = "application/wasm";
33

44
export const CORE_VERSION = "0.12.10";
5-
export const CORE_URL = `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
5+
export const CORE_URL = `https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
66

77
export enum FFMessageType {
88
LOAD = "LOAD",

packages/ffmpeg/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export interface FFMessageLoadConfig {
77
/**
88
* `ffmpeg-core.js` URL.
99
*
10-
* @defaultValue `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
10+
* @defaultValue `https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
1111
*/
1212
coreURL?: string;
1313
/**
1414
* `ffmpeg-core.wasm` URL.
1515
*
16-
* @defaultValue `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`;
16+
* @defaultValue `https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`;
1717
*/
1818
wasmURL?: string;
1919
/**
2020
* `ffmpeg-core.worker.js` URL. This worker is spawned when using multithread version of ffmpeg-core.
2121
*
2222
* @ref: https://ffmpegwasm.netlify.app/docs/overview#architecture
23-
* @defaultValue `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`;
23+
* @defaultValue `https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`;
2424
*/
2525
workerURL?: string;
2626
/**

0 commit comments

Comments
 (0)