You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: videodb/editor.py
+17-4Lines changed: 17 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,20 @@ class AssetType(str, Enum):
15
15
16
16
17
17
classFit(str, Enum):
18
-
"""The fit mode to apply to the asset."""
18
+
"""Set how the asset should be scaled to fit the viewport using one of the following options:
19
+
crop (default) - scale the asset to fill the viewport while maintaining the aspect ratio. The asset will be cropped if it exceeds the bounds of the viewport.
20
+
21
+
cover - stretch the asset to fill the viewport without maintaining the aspect ratio.
22
+
contain - fit the entire asset within the viewport while maintaining the original aspect ratio.
23
+
none - preserves the original asset dimensions and does not apply any scaling."""
19
24
20
25
crop="crop"
21
26
cover="cover"
22
27
contain="contain"
23
28
24
29
25
30
classPosition(str, Enum):
26
-
"""The position of the asset on the timeline."""
31
+
"""Place the asset in one of nine predefined positions of the viewport. This is most effective for when the asset is scaled and you want to position the element to a specific position."""
27
32
28
33
top="top"
29
34
bottom="bottom"
@@ -607,6 +612,8 @@ def to_json(self):
607
612
608
613
609
614
classTrackItem:
615
+
"""Clip wrapper"""
616
+
610
617
def__init__(self, start: int, clip: Clip):
611
618
self.start=start
612
619
self.clip=clip
@@ -619,11 +626,15 @@ def to_json(self):
619
626
620
627
621
628
classTrack:
629
+
"""A track contains an array of clips. Tracks are layered on top of each other in the order in the array. The top most track will render on top of those below it."""
630
+
622
631
def__init__(self, z_index: int=0):
623
632
self.clips: List[TrackItem] = []
624
633
self.z_index: int=z_index
625
634
626
635
defadd_clip(self, start: int, clip: Clip):
636
+
"""Add a clip to the track."""
637
+
627
638
self.clips.append(TrackItem(start, clip))
628
639
629
640
defto_json(self):
@@ -633,7 +644,9 @@ def to_json(self):
633
644
}
634
645
635
646
636
-
classTimelineV2:
647
+
classTimeline:
648
+
"""A timeline represents the contents of a video edit over time, an audio edit over time, in seconds, or an image layout. A timeline consists of layers called tracks. Tracks are composed of titles, images, audio, html or video segments referred to as clips which are placed along the track at specific starting point and lasting for a specific amount of time."""
0 commit comments