0

With this:

import gst
self.player = gst.element_factory_make("playbin", "player")
self.player.set_property('uri','file:///test.ogg))
self.player.set_state(gst.STATE_PLAYING)

How could I force a infinite loop of that test.ogg file?

royhowie
  • 11,075
  • 14
  • 50
  • 67
Costales
  • 2,799
  • 1
  • 17
  • 21
  • 1
    Answers to [this question](http://stackoverflow.com/questions/6833147/looping-a-video-with-gstreamer-and-gst-launch) indicate that you probably can't do it from within GStreamer, but you should be able to watch for the "stop" event and trigger a new play. See [`self.bus.add_signal_watch()`](https://wiki.python.org/moin/PyQt/Using%20GStreamer%20with%20PyQt). – Simon MᶜKenzie Apr 01 '15 at 00:44

1 Answers1

0

Here is the code:

def _loop(self, message):
    self.player.set_property('uri', 'file://your_file_path')

self.player = Gst.ElementFactory.make(PLAYBIN, "player")
self.player.connect("about-to-finish", self._loop)
self.player.set_property('uri', 'file://your_file_path')

Cheers!

Costales
  • 2,799
  • 1
  • 17
  • 21