Skip to content

Commit

Permalink
feat: createCombinator support more augs
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Nov 1, 2024
1 parent 800ac78 commit 3e99fac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/witty-suits-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@webav/av-canvas': patch
'@webav/av-cliper': patch
---

feat: createCombinator support more augs
8 changes: 2 additions & 6 deletions packages/av-canvas/src/av-canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
OffscreenSprite,
VisibleSprite,
MediaStreamClip,
ICombinatorOpts,
} from '@webav/av-cliper';
import { renderCtrls } from './sprites/render-ctrl';
import { ESpriteManagerEvt, SpriteManager } from './sprites/sprite-manager';
Expand Down Expand Up @@ -406,12 +407,7 @@ export class AVCanvas {
*
* @see [视频剪辑](https://bilibili.github.io/WebAV/demo/6_4-video-editor)
*/
async createCombinator(
opts: {
bitrate?: number;
__unsafe_hardwareAcceleration__?: HardwareAcceleration;
} = {},
) {
async createCombinator(opts: ICombinatorOpts = {}) {
const com = new Combinator({ ...this.#opts, ...opts });
const sprites = this.#spriteManager.getSprites({ time: false });
if (sprites.length === 0) throw Error('No sprite added');
Expand Down
2 changes: 1 addition & 1 deletion packages/av-cliper/src/combinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { OffscreenSprite } from './sprite/offscreen-sprite';
import { sleep } from './av-utils';
import { DEFAULT_AUDIO_CONF } from './clips';

interface ICombinatorOpts {
export interface ICombinatorOpts {
width?: number;
height?: number;
bitrate?: number;
Expand Down
1 change: 1 addition & 0 deletions packages/av-cliper/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export { OffscreenSprite } from './sprite/offscreen-sprite';
export { VisibleSprite } from './sprite/visible-sprite';
export { Rect } from './sprite/rect';
export { Combinator } from './combinator';
export type { ICombinatorOpts } from './combinator';

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

0 comments on commit 3e99fac

Please sign in to comment.