Skip to content

Commit 7739f69

Browse files
committed
chore: export IMP4ClipOpts type
1 parent b1f0516 commit 7739f69

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

packages/av-canvas/demo/video-editor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ function App() {
273273
: (await fetch('./video/bunny_0.mp4')).body!;
274274
const clip = new MP4Clip(stream);
275275
const spr = new VisibleSprite(clip);
276+
// spr.rect.fixedAspectRatio = true;
276277
await avCvs?.addSprite(spr);
277278
addSprite2Track('1-video', spr, '视频');
278279
}}

packages/av-cliper/src/clips/mp4-clip.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface MP4DecoderConf {
2525
audio: AudioDecoderConfig | null;
2626
}
2727

28-
interface MP4ClipOpts {
28+
export interface IMP4ClipOpts {
2929
audio?: boolean | { volume: number };
3030
/**
3131
* 不安全,随时可能废弃
@@ -120,11 +120,11 @@ export class MP4Clip implements IClip {
120120
audio: null,
121121
};
122122

123-
#opts: MP4ClipOpts = { audio: true };
123+
#opts: IMP4ClipOpts = { audio: true };
124124

125125
constructor(
126126
source: OPFSToolFile | ReadableStream<Uint8Array> | MPClipCloneArgs,
127-
opts: MP4ClipOpts = {},
127+
opts: IMP4ClipOpts = {},
128128
) {
129129
if (
130130
!(source instanceof ReadableStream) &&
@@ -518,7 +518,7 @@ function genDecoder(
518518
};
519519
}
520520

521-
async function mp4FileToSamples(otFile: OPFSToolFile, opts: MP4ClipOpts = {}) {
521+
async function mp4FileToSamples(otFile: OPFSToolFile, opts: IMP4ClipOpts = {}) {
522522
let mp4Info: MP4Info | null = null;
523523
const decoderConf: MP4DecoderConf = { video: null, audio: null };
524524
let videoSamples: ExtMP4Sample[] = [];

packages/av-cliper/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
export { createChromakey } from './chromakey';
12
export { renderTxt2ImgBitmap } from './dom-utils';
23
export { fastConcatMP4, fixFMP4Duration, mixinMP4AndAudio } from './mp4-utils';
3-
export { createChromakey } from './chromakey';
44

55
export {
6-
MP4Clip,
7-
ImgClip,
86
AudioClip,
9-
MediaStreamClip,
107
EmbedSubtitlesClip,
8+
ImgClip,
9+
MP4Clip,
10+
MediaStreamClip,
1111
} from './clips';
12-
export type { IClip } from './clips';
13-
export { OffscreenSprite } from './sprite/offscreen-sprite';
14-
export { VisibleSprite } from './sprite/visible-sprite';
15-
export { Rect } from './sprite/rect';
12+
export type { IClip, IMP4ClipOpts } from './clips';
1613
export { Combinator } from './combinator';
1714
export type { ICombinatorOpts } from './combinator';
15+
export { OffscreenSprite } from './sprite/offscreen-sprite';
16+
export { Rect } from './sprite/rect';
17+
export { VisibleSprite } from './sprite/visible-sprite';
1818

1919
export { Log } from '@webav/internal-utils';

0 commit comments

Comments
 (0)