Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: typo fix #192

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/av-cliper/demo/concat-media.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<span> | </span>
<button id="test-mem-cost">test mem cost</button>
<p />
<div id="player-continer">
<div id="player-container">
</div>
<hr>
<script type="module" src="concat-media.ts"></script>
Expand Down
20 changes: 10 additions & 10 deletions packages/av-cliper/demo/concat-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { createChromakey, fastConcatMP4 } from '../src';
}
})();

const playerContiner = document.querySelector('#player-continer')!;
const playerContainer = document.querySelector('#player-container')!;

document.querySelector('#mp4-img')?.addEventListener('click', () => {
(async () => {
const resList = ['./video/webav1.mp4', './img/bunny.png'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const spr1 = new OffscreenSprite(
new MP4Clip((await fetch(resList[0])).body!),
Expand Down Expand Up @@ -84,7 +84,7 @@ document.querySelector('#mp4-img')?.addEventListener('click', () => {
document.querySelector('#mp4-mp3')?.addEventListener('click', () => {
(async () => {
const resList = ['./video/bunny_0.mp4', './audio/44.1kHz-2chan.mp3'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const resp1 = await fetch(resList[0]);
const mp4Clip = new MP4Clip(resp1.body!);
Expand Down Expand Up @@ -115,7 +115,7 @@ document.querySelector('#mp4-mp3')?.addEventListener('click', () => {
document.querySelector('#mix-audio')?.addEventListener('click', () => {
(async () => {
const resList = ['./audio/44.1kHz-2chan.m4a', './audio/16kHz-1chan.mp3'];
const { loadStream } = playOutputStream(resList, playerContiner, 'audio');
const { loadStream } = playOutputStream(resList, playerContainer, 'audio');

const resp1 = await fetch(resList[0]);
const resp2 = await fetch(resList[1]);
Expand All @@ -137,7 +137,7 @@ document.querySelector('#mix-audio')?.addEventListener('click', () => {
document.querySelector('#concat-audio')?.addEventListener('click', () => {
(async () => {
const resList = ['./audio/16kHz-1chan.mp3', './audio/44.1kHz-2chan.m4a'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const clip = await concatAudioClip(
await Promise.all(
Expand All @@ -157,7 +157,7 @@ document.querySelector('#concat-audio')?.addEventListener('click', () => {
document.querySelector('#gif-m4a')?.addEventListener('click', () => {
(async () => {
const resList = ['./img/animated.gif', './audio/44.1kHz-2chan.m4a'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const resp1 = await fetch(resList[0]);
const spr1 = new OffscreenSprite(
Expand All @@ -178,7 +178,7 @@ document.querySelector('#gif-m4a')?.addEventListener('click', () => {
document.querySelector('#mp4-srt')?.addEventListener('click', () => {
(async () => {
const resList = ['./video/webav1.mp4', './subtitles/test-sample.srt'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const resp1 = await fetch(resList[0]);
const spr1 = new OffscreenSprite(new MP4Clip(resp1.body!));
Expand Down Expand Up @@ -214,7 +214,7 @@ document.querySelector('#mp4-srt')?.addEventListener('click', () => {
document.querySelector('#mp4-chromakey')?.addEventListener('click', () => {
(async () => {
const resList = ['./video/chromakey-test.mp4', './img/bunny.png'];
const { loadStream } = playOutputStream(resList, playerContiner);
const { loadStream } = playOutputStream(resList, playerContainer);

const width = 1280;
const height = 720;
Expand Down Expand Up @@ -313,7 +313,7 @@ document.querySelector('#complex')?.addEventListener('click', () => {
return com.output();
});

const { loadStream } = playOutputStream(mp4List, playerContiner);
const { loadStream } = playOutputStream(mp4List, playerContainer);

// then concat multiple videos
await loadStream(await fastConcatMP4(await Promise.all(coms)));
Expand All @@ -324,7 +324,7 @@ document.querySelector('#test-mem-cost')?.addEventListener('click', () => {
(async () => {
{
const resURL = './video/pri-linglong.mp4';
const { loadStream } = playOutputStream([resURL], playerContiner);
const { loadStream } = playOutputStream([resURL], playerContainer);

const spr1 = new OffscreenSprite(
new MP4Clip((await fetch(resURL)).body!),
Expand Down
4 changes: 2 additions & 2 deletions packages/av-cliper/src/clips/mp4-clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class MP4Clip implements IClip {
this.#videoSamples = videoSamples;
this.#audioSamples = audioSamples;
this.#decoderConf = decoderConf;
const { videoFrameFinder, audioFrameFinder } = genDeocder(
const { videoFrameFinder, audioFrameFinder } = genDecoder(
{
video:
decoderConf.video == null
Expand Down Expand Up @@ -488,7 +488,7 @@ function genMeta(
return meta;
}

function genDeocder(
function genDecoder(
decoderConf: MP4DecoderConf,
localFileReader: LocalFileReader,
videoSamples: ExtMP4Sample[],
Expand Down