gtk.media_stream
Module for [MediaStream] class
Types 3
[gtk.media_stream.MediaStream] is the integration point for media playback inside GTK.
GTK provides an implementation of the [gtk.media_stream.MediaStream] interface that is called [gtk.media_file.MediaFile].
Apart from application-facing API for stream playback, [gtk.media_stream.MediaStream] has a number of APIs that are only useful for implementations and should not be used in applications: [gtk.media_stream.MediaStream.prepared], [gtk.media_stream.MediaStream.unprepared], [gtk.media_stream.MediaStream.update], [gtk.media_stream.MediaStream.ended], [gtk.media_stream.MediaStream.seekSuccess], [gtk.media_stream.MediaStream.seekFailed], [gtk.media_stream.MediaStream.gerror], [gtk.media_stream.MediaStream.error], [gtk.media_stream.MediaStream.errorValist].
MediaStream self()Returns `this`, for use in `with` statements.MediaStreamGidBuilder builder()Get builder for [gtk.media_stream.MediaStream] Returns: New builder objectlong duration() @propertyGet `duration` property. Returns: The stream's duration in microseconds or 0 if unknown.bool loop() @propertyGet `loop` property. Returns: Try to restart the media from the beginning once it ended.void loop(bool propval) @propertySet `loop` property. Params: propval = Try to restart the media from the beginning once it ended.void muted(bool propval) @propertySet `muted` property. Params: propval = Whether the audio stream should be muted.void playing(bool propval) @propertySet `playing` property. Params: propval = Whether the stream is currently playing.bool seekable() @propertyGet `seekable` property. Returns: Set unless the stream is known to not support seeking.long timestamp() @propertyGet `timestamp` property. Returns: The current presentation timestamp in microseconds.void volume(double propval) @propertySet `volume` property. Params: propval = Volume of the audio stream.void gerror(glib.error.ErrorWrap error)Sets self into an error state.long getDuration()Gets the duration of the stream.bool getEnded()Returns whether the streams playback is finished. Returns: true if playback is finishedglib.error.ErrorWrap getError()If the stream is in an error state, returns the [glib.error.ErrorWrap] explaining that state.bool getLoop()Returns whether the stream is set to loop.bool getMuted()Returns whether the audio for the stream is muted.bool getPlaying()Return whether the stream is currently playing. Returns: true if the stream is playinglong getTimestamp()Returns the current presentation timestamp in microseconds. Returns: the timestamp in microsecondsdouble getVolume()Returns the volume of the audio for the stream.bool hasAudio()Returns whether the stream has audio. Returns: true if the stream has audiobool hasVideo()Returns whether the stream has video. Returns: true if the stream has videobool isPrepared()Returns whether the stream has finished initializing.bool isSeekable()Checks if a stream may be seekable.bool isSeeking()Checks if there is currently a seek operation going on. Returns: true if a seek operation is ongoing.void pause()Pauses playback of the stream.void play()Starts playing the stream.void realize(gdk.surface.Surface surface)Called by users to attach the media stream to a [gdk.surface.Surface] they manage.void seek(long timestamp)Start a seek operation on self to timestamp.void seekFailed()Ends a seek operation started via GtkMediaStream.seek() as a failure.void seekSuccess()Ends a seek operation started via GtkMediaStream.seek() successfully.void setLoop(bool loop)Sets whether the stream should loop.void setMuted(bool muted)Sets whether the audio stream should be muted.void setPlaying(bool playing)Starts or pauses playback of the stream.void setVolume(double volume)Sets the volume of the audio stream.void streamEnded()Pauses the media stream and marks it as ended.void streamPrepared(bool hasAudio, bool hasVideo, bool seekable, long duration)Called by [gtk.media_stream.MediaStream] implementations to advertise the stream being ready to play and providing details about the stream.void streamUnprepared()Resets a given media stream implementation.void unrealize(gdk.surface.Surface surface)Undoes a previous call to [gtk.media_stream.MediaStream.realize].void update(long timestamp)Media stream implementations should regularly call this function to update the timestamp reported by the stream.T loop(bool propval)Set `loop` property. Params: propval = Try to restart the media from the beginning once it ended. Returns: Builder instance for fluent chainingT muted(bool propval)Set `muted` property. Params: propval = Whether the audio stream should be muted. Returns: Builder instance for fluent chainingT playing(bool propval)Set `playing` property. Params: propval = Whether the stream is currently playing. Returns: Builder instance for fluent chainingT volume(double propval)Set `volume` property. Params: propval = Volume of the audio stream. Returns: Builder instance for fluent chainingFluent builder for [gtk.media_stream.MediaStream]