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 error: Varargs parameter is not supported

  • parameter args: va_list

  • 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: <Error class: unknown class>

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: <Error class: unknown class>

The current presentation timestamp in microseconds.

Link copied to clipboard
open var volume: <Error class: unknown class>

Volume of the audio stream.

Functions

Link copied to clipboard
open fun ended()

Pauses the media stream and marks it as ended.

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

Sets @self into an error state.

Link copied to clipboard
open fun getEnded(): Boolean

Returns whether the streams playback is finished.

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 prepared(hasAudio: Boolean, hasVideo: Boolean, seekable: Boolean, duration: <Error class: unknown class>)

Same as gtk_media_stream_stream_prepared().

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: <Error class: unknown class>)

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 streamEnded()

Pauses the media stream and marks it as ended.

Link copied to clipboard
open fun streamPrepared(hasAudio: Boolean, hasVideo: Boolean, seekable: Boolean, duration: <Error class: unknown class>)

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 unprepared()

Same as gtk_media_stream_stream_unprepared().

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: <Error class: unknown class>)

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