MediaStream

open class MediaStream(pointer: <Error class: unknown class><<Error class: unknown class>>)

GtkMediaStream is the integration point for media playback inside GTK.

GTK provides an implementation of the GtkMediaStream interface that is called class@Gtk.MediaFile.

Apart from application-facing API for stream playback, GtkMediaStream has a number of APIs that are only useful for implementations and should not be used in applications: method@Gtk.MediaStream.prepared, method@Gtk.MediaStream.unprepared, method@Gtk.MediaStream.update, method@Gtk.MediaStream.ended, method@Gtk.MediaStream.seek_success, method@Gtk.MediaStream.seek_failed, method@Gtk.MediaStream.gerror, method@Gtk.MediaStream.error, method@Gtk.MediaStream.error_valist.

Skipped during bindings generation

  • method ended: Property has no getter nor setter

  • method has-audio: Property has no getter nor setter

  • method has-video: Property has no getter nor setter

  • method prepared: Property has no getter nor setter

  • method seekable: Property has no getter nor setter

  • method seeking: Property has no getter nor setter

Inheritors

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val duration: Long

The stream's duration in microseconds or 0 if unknown.

Link copied to clipboard
open val error: <Error class: unknown class>?

null for a properly working stream or the GError that the stream is in.

Link copied to clipboard
open val gdkPaintablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkMediaStreamPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var loop: Boolean

Try to restart the media from the beginning once it ended.

Link copied to clipboard
open var muted: Boolean

Whether the audio stream should be muted.

Link copied to clipboard
open var playing: Boolean

Whether the stream is currently playing.

Link copied to clipboard
open val timestamp: Long

The current presentation timestamp in microseconds.

Link copied to clipboard
open var volume: Double

Volume of the audio stream.

Functions

Link copied to clipboard
open fun gerror(error: <Error class: unknown class>)

Sets @self into an error state.

Link copied to clipboard
open fun getDuration(): Long

Gets the duration of the stream.

Link copied to clipboard
open fun getEnded(): Boolean

Returns whether the streams playback is finished.

Link copied to clipboard
open fun getError(): <Error class: unknown class>?

If the stream is in an error state, returns the GError explaining that state.

Link copied to clipboard
open fun getLoop(): Boolean

Returns whether the stream is set to loop.

Link copied to clipboard
open fun getMuted(): Boolean

Returns whether the audio for the stream is muted.

Link copied to clipboard
open fun getPlaying(): Boolean

Return whether the stream is currently playing.

Link copied to clipboard
open fun getTimestamp(): Long

Returns the current presentation timestamp in microseconds.

Link copied to clipboard
open fun getVolume(): Double

Returns the volume of the audio for the stream.

Link copied to clipboard
open fun hasAudio(): Boolean

Returns whether the stream has audio.

Link copied to clipboard
open fun hasVideo(): Boolean

Returns whether the stream has video.

Link copied to clipboard
open fun isPrepared(): Boolean

Returns whether the stream has finished initializing.

Link copied to clipboard
open fun isSeekable(): Boolean

Checks if a stream may be seekable.

Link copied to clipboard
open fun isSeeking(): Boolean

Checks if there is currently a seek operation going on.

Link copied to clipboard
open fun pause()

Pauses playback of the stream.

Link copied to clipboard
open fun play()

Starts playing the stream.

Link copied to clipboard
open fun realize(surface: <Error class: unknown class>)

Called by users to attach the media stream to a GdkSurface they manage.

Link copied to clipboard
open fun seek(timestamp: Long)

Start a seek operation on @self to @timestamp.

Link copied to clipboard
open fun seekFailed()

Ends a seek operation started via GtkMediaStream.seek() as a failure.

Link copied to clipboard
open fun seekSuccess()

Ends a seek operation started via GtkMediaStream.seek() successfully.

Link copied to clipboard
open fun setLoop(loop: Boolean)

Sets whether the stream should loop.

Link copied to clipboard
open fun setMuted(muted: Boolean)

Sets whether the audio stream should be muted.

Link copied to clipboard
open fun setPlaying(playing: Boolean)

Starts or pauses playback of the stream.

Link copied to clipboard
open fun setVolume(volume: Double)

Sets the volume of the audio stream.

Link copied to clipboard
open fun streamEnded()

Pauses the media stream and marks it as ended.

Link copied to clipboard
open fun streamPrepared(hasAudio: Boolean, hasVideo: Boolean, seekable: Boolean, duration: Long)

Called by GtkMediaStream implementations to advertise the stream being ready to play and providing details about the stream.

Link copied to clipboard
open fun streamUnprepared()

Resets a given media stream implementation.

Link copied to clipboard
open fun unrealize(surface: <Error class: unknown class>)

Undoes a previous call to gtk_media_stream_realize().

Link copied to clipboard
open fun update(timestamp: Long)

Media stream implementations should regularly call this function to update the timestamp reported by the stream.