Basics
Guides
API Reference
Basics
Guides
API Reference
[233:14] static extends: object
Alternate constructors for MediaFile. Usage:
MediaFileCtors.<name>(...). The primary constructor lives
directly on MediaFile.
newForFile (object file)
Creates a new media file to play @file.
file is The file to play.A new MediaFile.newForFilename (string filename)
Creates a new media file for the given filename. This is a utility function that converts the given @filename to a
GFileand calls [ctor@Gtk.MediaFile.new_for_file].
filename is filename to open.A new MediaFile.newForInputStream (object stream)
Creates a new media file to play @stream. If you want the resulting media to be seekable, the stream should implement the
GSeekableinterface.
stream is The stream to play.A new MediaFile.newForResource (string resource_path)
Creates a new new media file for the given resource. This is a utility function that converts the given @resource to a
GFileand calls [ctor@Gtk.MediaFile.new_for_file].
resource_path is resource path to open.A new MediaFile.[16:7] extends: object
Implements the GtkMediaStream interface for files. This provides a simple
way to play back video files with GTK. GTK provides a GIO extension point for
GtkMediaFile implementations to allow for external implementations using
various media frameworks. GTK itself includes an implementation using
GStreamer.
MediaFile ()
Creates a new empty media file.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asMediaStream ()
Wraps this handle as
MediaStream.
A MediaStream object.asPaintable ()
Wraps this handle as
Paintable.
A Paintable object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setFile (object Value)
The file being played back or %NULL if not playing a file.
Value is the new property value.None.setInputstream (object Value)
The stream being played back or %NULL if not playing a stream. This is %NULL when playing a file.
Value is the new property value.None.clear ()
Resets the media file to be empty.
None.get_file ()
Returns the file that @self is currently playing from. When @self is not playing or not playing from a file, %NULL is returned.
get_input_stream ()
Returns the stream that @self is currently playing from. When @self is not playing or not playing from a stream, %NULL is returned.
set_file (object file)
Sets the
GtkMediaFileto play the given file. If any file is still playing, stop playing it.
file is the file to play.None.set_filename (string filename)
Sets the
GtkMediaFileto play the given file. This is a utility function that converts the given @filename to aGFileand calls [method@Gtk.MediaFile.set_file].
filename is name of file to play.None.set_input_stream (object stream)
Sets the
GtkMediaFileto play the given stream. If anything is still playing, stop playing it. Full control about the @stream is assumed for the duration of playback. The stream will not be closed.
stream is the stream to play from.None.set_resource (string resource_path)
Sets the
GtkMediaFileto play the given resource. This is a utility function that converts the given @resource_path to aGFileand calls [method@Gtk.MediaFile.set_file].
resource_path is path to resource to play.None.[292:14] static extends: object
Generated metadata helpers for MediaFile class surfaces.
properties ()
Returns property metadata for
MediaFile.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.