Enigma2 plugin to to play various online streams (mostly Latvian).

player-minimal.py 619B

123456789101112131415161718192021
  1. #!/usr/bin/env python
  2. import gi
  3. gi.require_version('Gst', '1.0')
  4. from gi.repository import GObject, Gst
  5. import os
  6. Gst.init(None)
  7. mainloop = GObject.MainLoop()
  8. #setting up a single "playbin" element which handles every part of the playback by itself
  9. pl = Gst.ElementFactory.make("playbin", "player")
  10. # copy a track to /tmp directory, just for testing
  11. uri = "http://walterebert.com/playground/video/hls/ts/480x270.m3u8"
  12. pl.set_property('uri',uri)
  13. # setting the volume property for the playbin element, as an example
  14. #pl.set_property('volume', 0.2)
  15. #running the playbin
  16. pl.set_state(Gst.State.PLAYING)
  17. mainloop.run()