From: Antonio Ospite Date: Mon, 28 Nov 2016 12:32:17 +0000 (+0100) Subject: vidi/Timeline.py: move pipeline player initialization to the __init__ method X-Git-Url: https://git.ao2.it/vidi-player.git/commitdiff_plain/59d336e34153115464426357afab9a7ac85a55d3?hp=9a8f764328f6b47707ed24acc9a5e2fc9a4fcf57 vidi/Timeline.py: move pipeline player initialization to the __init__ method --- diff --git a/vidi/Timeline.py b/vidi/Timeline.py index 43bb9c9..c1e9698 100755 --- a/vidi/Timeline.py +++ b/vidi/Timeline.py @@ -43,6 +43,10 @@ class Timeline(object): self.layer = self.timeline.append_layer() + ges_pipeline = GES.Pipeline() + ges_pipeline.set_timeline(self.timeline) + self.player = Player(ges_pipeline) + def add_clip(self, clip_path, start_time, duration): clip_uri = Gst.filename_to_uri(clip_path) asset = GES.UriClipAsset.request_sync(clip_uri) @@ -51,10 +55,7 @@ class Timeline(object): def play(self): self.timeline.commit() - - ges_pipeline = GES.Pipeline() - ges_pipeline.set_timeline(self.timeline) - Player(ges_pipeline).play() + self.player.play() def save(self, path): uri = Gst.filename_to_uri(path)