But how can I know when the video playback reaches the end of the stream? The MediaStream methods seem to be only “stateful”, that is, I would have to implement some sort of timeout to check if the stream is closed.
How to connect to this media_stream (or its underlying bus, because I know how to connect to a Gst pipeline bus eos signal) to fire a callback function on the “end of stream” signal?
It works perfectly thanks a lot, and may I add, where is this stream.connect() function documented? Shouldn’t it be at least somehow linked in the MediaStream class documentation? Also is there a list somewhere of all the possible signals to connect to?
After a month now of working with Gtk4 and searching for documentation, I really feel like something is missing. Is there a book I could buy? My only reference is the official documentation - that does not even mention Python - and the PyGObject API Reference (thank God for that BTW) but is there a Gtk4 Python documentation - ideally with examples, for complex new concepts like actions - planned?
The “connect” method comes from GObject, in Python.
You’re looking at the C API reference. In C, there is no “connect” method: the function is called g_signal_connect().
It’s part of the API reference.
The “notify” signal is detailed: the name of the signal is “notify”, and the part after the :: separator is the name of a readable property—in this case, the “ended” property on the media stream object.
No, there are no books.
The GObject C documentation comes with a tutorial and an explanation of the type system concepts, including signals and properties. Of course, those are mostly for people who understand C.
Python documentation isn’t great, but any contribution there is very much welcome.