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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
MediaStream self() nothrowReturns `this`, for use in `with` statements.
MediaStreamGidBuilder builder() static nothrowGet builder for [gtk.media_stream.MediaStream] Returns: New builder object
long duration() @property nothrowGet `duration` property. Returns: The stream's duration in microseconds or 0 if unknown.
bool loop() @property nothrowGet `loop` property. Returns: Try to restart the media from the beginning once it ended.
void loop(bool propval) @property nothrowSet `loop` property. Params: propval = Try to restart the media from the beginning once it ended.
bool muted() @property nothrowGet `muted` property. Returns: Whether the audio stream should be muted.
void muted(bool propval) @property nothrowSet `muted` property. Params: propval = Whether the audio stream should be muted.
bool playing() @property nothrowGet `playing` property. Returns: Whether the stream is currently playing.
void playing(bool propval) @property nothrowSet `playing` property. Params: propval = Whether the stream is currently playing.
bool seekable() @property nothrowGet `seekable` property. Returns: Set unless the stream is known to not support seeking.
bool seeking() @property nothrowGet `seeking` property. Returns: Set while a seek is in progress.
long timestamp() @property nothrowGet `timestamp` property. Returns: The current presentation timestamp in microseconds.
double volume() @property nothrowGet `volume` property. Returns: Volume of the audio stream.
void volume(double propval) @property nothrowSet `volume` property. Params: propval = Volume of the audio stream.
void gerror(glib.error.ErrorWrap error) nothrowSets self into an error state.
long getDuration() nothrowGets the duration of the stream.
bool getEnded() nothrowReturns whether the streams playback is finished. Returns: true if playback is finished
glib.error.ErrorWrap getError() nothrowIf the stream is in an error state, returns the [glib.error.ErrorWrap] explaining that state.
bool getLoop() nothrowReturns whether the stream is set to loop.
bool getMuted() nothrowReturns whether the audio for the stream is muted.
bool getPlaying() nothrowReturn whether the stream is currently playing. Returns: true if the stream is playing
long getTimestamp() nothrowReturns the current presentation timestamp in microseconds. Returns: the timestamp in microseconds
double getVolume() nothrowReturns the volume of the audio for the stream.
bool hasAudio() nothrowReturns whether the stream has audio. Returns: true if the stream has audio
bool hasVideo() nothrowReturns whether the stream has video. Returns: true if the stream has video
bool isPrepared() nothrowReturns whether the stream has finished initializing.
bool isSeekable() nothrowChecks if a stream may be seekable.
bool isSeeking() nothrowChecks if there is currently a seek operation going on. Returns: true if a seek operation is ongoing.
void pause() nothrowPauses playback of the stream.
void play() nothrowStarts playing the stream.
void realize(gdk.surface.Surface surface) nothrowCalled by users to attach the media stream to a [gdk.surface.Surface] they manage.
void seek(long timestamp) nothrowStart a seek operation on self to timestamp.
void seekFailed() nothrowEnds a seek operation started via GtkMediaStream.seek() as a failure.
void seekSuccess() nothrowEnds a seek operation started via GtkMediaStream.seek() successfully.
void setLoop(bool loop) nothrowSets whether the stream should loop.
void setMuted(bool muted) nothrowSets whether the audio stream should be muted.
void setPlaying(bool playing) nothrowStarts or pauses playback of the stream.
void setVolume(double volume) nothrowSets the volume of the audio stream.
void streamEnded() nothrowPauses the media stream and marks it as ended.
void streamPrepared(bool hasAudio, bool hasVideo, bool seekable, long duration) nothrowCalled by [gtk.media_stream.MediaStream] implementations to advertise the stream being ready to play and providing details about the stream.
void streamUnprepared() nothrowResets a given media stream implementation.
void unrealize(gdk.surface.Surface surface) nothrowUndoes a previous call to [gtk.media_stream.MediaStream.realize].
void update(long timestamp) nothrowMedia stream implementations should regularly call this function to update the timestamp reported by the stream.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gtk.media_stream.MediaStream

Methods
T loop(bool propval) nothrowSet `loop` property. Params: propval = Try to restart the media from the beginning once it ended. Returns: Builder instance for fluent chaining
T muted(bool propval) nothrowSet `muted` property. Params: propval = Whether the audio stream should be muted. Returns: Builder instance for fluent chaining
T playing(bool propval) nothrowSet `playing` property. Params: propval = Whether the stream is currently playing. Returns: Builder instance for fluent chaining
T volume(double propval) nothrowSet `volume` property. Params: propval = Volume of the audio stream. Returns: Builder instance for fluent chaining

Fluent builder for gtk.media_stream.MediaStream

Methods
MediaStream build() nothrowCreate object from builder. Returns: New object