Skip to content

GtkMediaStream with gstreamer backend isn't 'prepared' until media is played

This seems to be a problem since: !3565 (merged)

To demo the problem, the video demo in gtk4-demo is currently set to autoplay, but it doesn't autoplay on load as expected because the "prepared" notification doesn't fire until the user explicitly presses play.

Similarly if the demo is tweaked to disable autoplay then on loading a video (or an audio-only ogg) the duration is not known or shown until the user presses play.

In LibreOffice we want to know what the size of the video is to position it before the user can interact with it to set it to play. We can workaround this to some degree by listening to "invalidate-size" on the GtkMediaStream object which updates for videos, but that doesn't work for audio-only streams.

So restore listening to media-info-updated but ignore -1 duration (which I see for audio-only where I get -1 and then a useful value) and 0 of the original report.

Merge request reports