@@ -15,8 +15,7 @@ import { Font, TextClip } from '../text';
1515import { ValidationError } from '../../errors' ;
1616import { VisualMixin , VisualMixinProps } from '../mixins' ;
1717import { MediaClip } from './media' ;
18-
19- import type { frame , MixinType } from '../../types' ;
18+ import { MixinType } from '../../types' ;
2019
2120describe ( 'The Media Clip' , ( ) => {
2221 const mockFn = vi . fn ( ) ;
@@ -51,22 +50,22 @@ describe('The Media Clip', () => {
5150 } ) ;
5251
5352 it ( 'should be able to cut a clip with subclip' , ( ) => {
54- clip . duration . frames = < frame > 600 ;
53+ clip . duration . frames = 600 ;
5554 expect ( clip . duration . frames ) . toBe ( 600 ) ;
5655 expect ( clip . range [ 0 ] . frames ) . toBe ( 0 ) ;
5756 // range 1 is using the duration timestamp by reference
5857 expect ( clip . range [ 1 ] . frames ) . toBe ( 600 ) ;
59- clip . subclip ( < frame > 30 , < frame > 360 ) ;
58+ clip . subclip ( 30 , 360 ) ;
6059 expect ( frameFn ) . toBeCalledTimes ( 1 ) ;
6160 expect ( clip . range [ 0 ] . frames ) . toBe ( 30 ) ;
6261 expect ( clip . range [ 1 ] . frames ) . toBe ( 360 ) ;
6362 } ) ;
6463
6564 it ( 'should lead to correct frames in combination with the offset' , ( ) => {
66- clip . duration . frames = < frame > 300 ;
67- clip . set ( { offset : < frame > 150 } ) ;
65+ clip . duration . frames = 300 ;
66+ clip . set ( { offset : 150 } ) ;
6867 expect ( frameFn ) . toBeCalledTimes ( 1 ) ;
69- clip . subclip ( < frame > 30 , < frame > 100 ) ;
68+ clip . subclip ( 30 , 100 ) ;
7069 expect ( frameFn ) . toBeCalledTimes ( 2 ) ;
7170 expect ( clip . range [ 0 ] . frames ) . toBe ( 30 ) ;
7271 expect ( clip . range [ 1 ] . frames ) . toBe ( 100 ) ;
@@ -75,45 +74,45 @@ describe('The Media Clip', () => {
7574 } ) ;
7675
7776 it ( 'should not be possible to clip outside the duration boundaries' , ( ) => {
78- clip . duration . frames = < frame > 20 ;
79- clip . subclip ( < frame > - 5 , < frame > 25 ) ;
77+ clip . duration . frames = 20 ;
78+ clip . subclip ( - 5 , 25 ) ;
8079 expect ( clip . range [ 0 ] . frames ) . toBe ( 0 ) ;
8180 expect ( clip . range [ 1 ] . frames ) . toBe ( 20 ) ;
8281 } ) ;
8382
8483 it ( 'should not be possible to reverse the upper and lower bound' , ( ) => {
85- expect ( ( ) => clip . subclip ( < frame > 10 , < frame > 5 ) ) . toThrowError ( ) ;
84+ expect ( ( ) => clip . subclip ( 10 , 5 ) ) . toThrowError ( ) ;
8685 } ) ;
8786
8887 it ( 'should be possible to set either the upper or the lower bound' , ( ) => {
89- clip . duration . frames = < frame > 20 ;
90- clip . subclip ( undefined , < frame > 15 ) ;
88+ clip . duration . frames = 20 ;
89+ clip . subclip ( undefined , 15 ) ;
9190 expect ( clip . range [ 1 ] . frames ) . toBe ( 15 ) ;
92- clip . subclip ( < frame > 5 ) ;
91+ clip . subclip ( 5 ) ;
9392 expect ( clip . range [ 0 ] . frames ) . toBe ( 5 ) ;
9493 } ) ;
9594
9695 it ( 'should be adapt the lower slice when setting start' , ( ) => {
97- clip . duration . frames = < frame > 20 ;
98- clip . subclip ( < frame > 5 , < frame > 15 ) ;
99- clip . set ( { offset : < frame > 5 } ) ;
96+ clip . duration . frames = 20 ;
97+ clip . subclip ( 5 , 15 ) ;
98+ clip . set ( { offset : 5 } ) ;
10099 expect ( clip . duration . frames ) . toBe ( 20 ) ;
101100 expect ( clip . start . frames ) . toBe ( 10 ) ;
102101 expect ( clip . stop . frames ) . toBe ( 20 ) ;
103102 // case in valid range
104- clip . set ( { start : < frame > 15 } ) ;
103+ clip . set ( { start : 15 } ) ;
105104 expect ( clip . start . frames ) . toBe ( 15 ) ;
106105 expect ( clip . offset . frames ) . toBe ( 5 ) ;
107106 expect ( clip . range [ 0 ] . frames ) . toBe ( 10 ) ;
108107 expect ( clip . range [ 1 ] . frames ) . toBe ( 15 ) ;
109108 // lower than min range
110- clip . set ( { start : < frame > 4 } ) ;
109+ clip . set ( { start : 4 } ) ;
111110 expect ( clip . start . frames ) . toBe ( 5 ) ;
112111 expect ( clip . offset . frames ) . toBe ( 5 ) ;
113112 expect ( clip . range [ 0 ] . frames ) . toBe ( 0 ) ;
114113 expect ( clip . range [ 1 ] . frames ) . toBe ( 15 ) ;
115114 // larger than max range
116- clip . set ( { start : < frame > 21 } ) ;
115+ clip . set ( { start : 21 } ) ;
117116 expect ( clip . start . frames ) . toBe ( 20 ) ;
118117 expect ( clip . offset . frames ) . toBe ( 5 ) ;
119118 expect ( clip . range [ 0 ] . frames ) . toBe ( 15 ) ;
@@ -123,28 +122,28 @@ describe('The Media Clip', () => {
123122 } ) ;
124123
125124 it ( 'should be adapt the upper slice when setting stop' , ( ) => {
126- clip . duration . frames = < frame > 20 ;
127- clip . subclip ( < frame > 5 , < frame > 15 ) ;
128- clip . set ( { offset : < frame > 5 } ) ;
125+ clip . duration . frames = 20 ;
126+ clip . subclip ( 5 , 15 ) ;
127+ clip . set ( { offset : 5 } ) ;
129128 expect ( clip . duration . frames ) . toBe ( 20 ) ;
130129 expect ( clip . start . frames ) . toBe ( 10 ) ;
131130 expect ( clip . stop . frames ) . toBe ( 20 ) ;
132131 // case in valid range
133- clip . set ( { stop : < frame > 15 } ) ;
132+ clip . set ( { stop : 15 } ) ;
134133 expect ( clip . start . frames ) . toBe ( 10 ) ;
135134 expect ( clip . offset . frames ) . toBe ( 5 ) ;
136135 expect ( clip . range [ 0 ] . frames ) . toBe ( 5 ) ;
137136 expect ( clip . range [ 1 ] . frames ) . toBe ( 10 ) ;
138137 // lower than min range
139- clip . set ( { stop : < frame > 10 } ) ;
138+ clip . set ( { stop : 10 } ) ;
140139 expect ( clip . start . frames ) . toBe ( 10 ) ;
141140 expect ( clip . offset . frames ) . toBe ( 5 ) ;
142141 expect ( clip . range [ 0 ] . frames ) . toBe ( 5 ) ;
143142 expect ( clip . range [ 0 ] . millis ) . toBe ( 167 ) ;
144143 expect ( clip . range [ 1 ] . frames ) . toBe ( 5 ) ;
145144 expect ( clip . range [ 1 ] . millis ) . toBe ( 168 ) ;
146145 // larger than max range
147- clip . set ( { stop : < frame > 26 } ) ;
146+ clip . set ( { stop : 26 } ) ;
148147 expect ( clip . start . frames ) . toBe ( 10 ) ;
149148 expect ( clip . offset . frames ) . toBe ( 5 ) ;
150149 expect ( clip . range [ 0 ] . frames ) . toBe ( 5 ) ;
@@ -153,8 +152,8 @@ describe('The Media Clip', () => {
153152
154153 it ( 'should be adaptable to a track' , async ( ) => {
155154 // use common multiples of 30 and 15
156- clip . duration . frames = < frame > 60 ;
157- clip . set ( { offset : < frame > 30 } ) . subclip ( < frame > 5 , < frame > 50 ) ;
155+ clip . duration . frames = 60 ;
156+ clip . set ( { offset : 30 } ) . subclip ( 5 , 50 ) ;
158157
159158 // 30 fps is the default
160159 const composition = new Composition ( ) ;
@@ -199,7 +198,7 @@ describe('The Media Clip', () => {
199198 it ( 'should be seekable' , async ( ) => {
200199 clip . element = document . createElement ( 'video' ) ;
201200 clip . duration . seconds = 20 ;
202- clip . subclip ( < frame > 150 , < frame > 450 ) ;
201+ clip . subclip ( 150 , 450 ) ;
203202 // in range
204203 clip . seek ( Timestamp . fromFrames ( 300 ) ) ;
205204 expect ( clip . element . currentTime ) . toBe ( 10 ) ;
@@ -214,8 +213,8 @@ describe('The Media Clip', () => {
214213 it ( 'should be seekable with offset' , async ( ) => {
215214 clip . element = document . createElement ( 'video' ) ;
216215 clip . duration . seconds = 20 ;
217- clip . subclip ( < frame > ( 5 * 30 ) , < frame > ( 15 * 30 ) ) ;
218- clip . set ( { offset : < frame > ( 10 * 30 ) } ) ;
216+ clip . subclip ( 5 * 30 , 15 * 30 ) ;
217+ clip . set ( { offset : 10 * 30 } ) ;
219218 expect ( clip . start . seconds ) . toBe ( 15 ) ;
220219 expect ( clip . stop . seconds ) . toBe ( 25 ) ;
221220 // in range
@@ -230,12 +229,12 @@ describe('The Media Clip', () => {
230229 } ) ;
231230
232231 it ( 'should offset by a given number' , async ( ) => {
233- clip . duration . frames = < frame > 20 ;
234- clip . set ( { offset : < frame > 100 , name : 'foo' } ) ;
232+ clip . duration . frames = 20 ;
233+ clip . set ( { offset : 100 , name : 'foo' } ) ;
235234 clip . state = 'READY' ;
236235
237- const clip2 = new MediaClip ( { offset : < frame > 60 } ) ;
238- clip2 . duration . frames = < frame > 30 ;
236+ const clip2 = new MediaClip ( { offset : 60 } ) ;
237+ clip2 . duration . frames = 30 ;
239238 clip2 . state = 'READY' ;
240239
241240 const composition = new Composition ( ) ;
@@ -246,14 +245,14 @@ describe('The Media Clip', () => {
246245 expect ( track . clips . length ) . toBe ( 2 ) ;
247246 expect ( track . clips [ 1 ] . name ) . toBe ( 'foo' ) ;
248247
249- clip . offsetBy ( < frame > - 80 ) ;
248+ clip . offsetBy ( - 80 ) ;
250249
251250 expect ( track . clips . length ) . toBe ( 2 ) ;
252251 expect ( track . clips [ 0 ] . name ) . toBe ( 'foo' ) ;
253252 expect ( track . clips [ 0 ] . start . frames ) . toBe ( 20 ) ;
254253 expect ( track . clips [ 0 ] . stop . frames ) . toBe ( 40 ) ;
255254
256- clip . offsetBy ( < frame > 30 ) ;
255+ clip . offsetBy ( 30 ) ;
257256
258257 expect ( track . clips . length ) . toBe ( 2 ) ;
259258 expect ( track . clips [ 0 ] . name ) . toBe ( 'foo' ) ;
0 commit comments