File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
packages/av-cliper/src/clips Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @webav/av-cliper ' : patch
3
+ ---
4
+
5
+ refactor: change the split method of the IClip interface to be optional #324
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ class CountdownClip implements IClip {
12
12
13
13
ready ;
14
14
15
+ get meta ( ) {
16
+ return {
17
+ width : this . #cvsEl. width ,
18
+ height : this . #cvsEl. height ,
19
+ duration : this . #duration * 1e6 ,
20
+ } ;
21
+ }
22
+
15
23
constructor ( duration : number ) {
16
24
this . #duration = duration ;
17
25
this . #cvsEl = document . createElement ( 'canvas' ) ;
@@ -55,8 +63,8 @@ class CountdownClip implements IClip {
55
63
} ;
56
64
}
57
65
58
- clone ( ) {
59
- return new CountdownClip ( this . #duration) ;
66
+ async clone ( ) {
67
+ return new CountdownClip ( this . #duration) as this ;
60
68
}
61
69
62
70
destroy ( ) {
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ export class EmbedSubtitlesClip implements IClip {
252
252
}
253
253
254
254
/**
255
- * @see {@link IClip.destroy }
255
+ * @see {@link IClip.split }
256
256
*/
257
257
async split ( time : number ) {
258
258
await this . ready ;
Original file line number Diff line number Diff line change @@ -42,14 +42,14 @@ export interface IClip {
42
42
clone : ( ) => Promise < this> ;
43
43
44
44
/**
45
- * 按指定时间切割,返回该时刻前后两个新素材
45
+ * 按指定时间切割,返回该时刻前后两个新素材,常用于剪辑场景按时间分割素材
46
46
*
47
47
* 该方法不会破坏原素材的数据
48
48
*
49
49
* @param time 时间,微秒
50
50
* @returns
51
51
*/
52
- split : ( time : number ) => Promise < [ this, this] > ;
52
+ split ? : ( time : number ) => Promise < [ this, this] > ;
53
53
54
54
/**
55
55
* 销毁实例,释放资源
You can’t perform that action at this time.
0 commit comments