Skip to content

Commit

Permalink
chore: update demo cdn path
Browse files Browse the repository at this point in the history
  • Loading branch information
ForeverSc committed Aug 12, 2024
1 parent 8300918 commit 992887e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3>Get All Video Packets</h3>
<script type="module">
(async () => {
const isDEV = import.meta.env && import.meta.env.DEV
const { WebDemuxer } = isDEV ? await import('./src') : await import('https://cdn.jsdelivr.net/npm/web-demuxer@latest/dist/web-demuxer.min.js')
const { WebDemuxer } = isDEV ? await import('./src') : await import('https://cdn.jsdelivr.net/npm/web-demuxer/+esm')

const demuxer = new WebDemuxer({
wasmLoaderPath: isDEV ? "http://localhost:5173/src/lib/ffmpeg.js" : "https://cdn.jsdelivr.net/npm/web-demuxer@latest/dist/wasm-files/ffmpeg.min.js",
Expand All @@ -121,9 +121,13 @@ <h3>Get All Video Packets</h3>

await demuxer.load(file);

const videoDecoderConfig = await demuxer.getVideoDecoderConfig();
const videoDecoderConfig = await demuxer.getVideoDecoderConfig().catch(e => {
console.error('get video decoder config error:', e);
});
const videoChunk = await demuxer.seekEncodedVideoChunk(seekTime);

console.log("getVideoStream", await demuxer.getVideoStream())

const decoder = new VideoDecoder({
output: (frame) => {
const scale = Math.min(canvas.width / frame.displayWidth, canvas.height / frame.displayHeight);
Expand Down

0 comments on commit 992887e

Please sign in to comment.