X-Git-Url: https://git.ao2.it/vidi-player.git/blobdiff_plain/6260f5eebfa3a865de0cecb78986d75bb1b661e1..8feb3b634207bd2176c686ce927a6e037460d7f7:/vidi/Timeline.py diff --git a/vidi/Timeline.py b/vidi/Timeline.py index fe98677..59c891a 100755 --- a/vidi/Timeline.py +++ b/vidi/Timeline.py @@ -53,6 +53,14 @@ class Timeline(object): self.layer.add_asset(asset, start_time * Gst.SECOND, 0, duration * Gst.SECOND, GES.TrackType.UNKNOWN) + def add_layer_clip(self, clip_path, start_time, duration): + """Add a clip on its own layer""" + clip_uri = Gst.filename_to_uri(clip_path) + asset = GES.UriClipAsset.request_sync(clip_uri) + new_layer = self.timeline.append_layer() + new_layer.add_asset(asset, start_time * Gst.SECOND, 0, + duration * Gst.SECOND, GES.TrackType.UNKNOWN) + def play(self): self.timeline.commit() self.player.play()