Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MediaFileCtors

[233:14] static extends: object

Alternate constructors for MediaFile. Usage: MediaFileCtors.<name>(...). The primary constructor lives directly on MediaFile.

Methods

  • newForFile (object file)

    Creates a new media file to play @file.

    • @p file is The file to play.
    • @r 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 GFile and calls [ctor@Gtk.MediaFile.new_for_file].

    • @p filename is filename to open.
    • @r 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 GSeekable interface.

    • @p stream is The stream to play.
    • @r 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 GFile and calls [ctor@Gtk.MediaFile.new_for_file].

    • @p resource_path is resource path to open.
    • @r A new MediaFile.

class: 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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asMediaStream ()

    Wraps this handle as MediaStream.

    • @r A MediaStream object.
  • asPaintable ()

    Wraps this handle as Paintable.

    • @r 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.

    • @p Value is the new property value.
    • @r None.
  • setInputstream (object Value)

    The stream being played back or %NULL if not playing a stream. This is %NULL when playing a file.

    • @p Value is the new property value.
    • @r None.
  • clear ()

    Resets the media file to be empty.

    • @r 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 GtkMediaFile to play the given file. If any file is still playing, stop playing it.

    • @p file is the file to play.
    • @r None.
  • set_filename (string filename)

    Sets the GtkMediaFile to play the given file. This is a utility function that converts the given @filename to a GFile and calls [method@Gtk.MediaFile.set_file].

    • @p filename is name of file to play.
    • @r None.
  • set_input_stream (object stream)

    Sets the GtkMediaFile to 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.

    • @p stream is the stream to play from.
    • @r None.
  • set_resource (string resource_path)

    Sets the GtkMediaFile to play the given resource. This is a utility function that converts the given @resource_path to a GFile and calls [method@Gtk.MediaFile.set_file].

    • @p resource_path is path to resource to play.
    • @r None.

class: MediaFileMeta

[292:14] static extends: object

Generated metadata helpers for MediaFile class surfaces.

Methods

  • properties ()

    Returns property metadata for MediaFile.

    • @r A list.