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