Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Video

[23:7] extends: object

Shows a GtkMediaStream with media controls. An
example GtkVideo The controls are available separately as [class@Gtk.MediaControls]. If you just want to display a video without controls, you can treat it like any other paintable and for example put it into a [class@Gtk.Picture]. GtkVideo aims to cover use cases such as previews, embedded animations, etc. It supports autoplay, looping, and simple media controls. It does not have support for video overlays, multichannel audio, device selection, or input. If you are writing a full-fledged video player, you may want to use the [iface@Gdk.Paintable] API and a media framework such as Gstreamer directly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Video ()

    Creates a new empty GtkVideo.

  • 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.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAutoplay (bool Value)

    If the video should automatically begin playing.

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

    The file played by this video if the video is playing a file.

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

    Whether to enable graphics offload.

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

    If new media files should be set to loop.

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

    The media-stream played

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

    Returns %TRUE if videos have been set to loop.

  • get_file ()

    Gets the file played by @self or %NULL if not playing back a file.

  • get_graphics_offload ()

    Returns whether graphics offload is enabled. See [class@Gtk.GraphicsOffload] for more information on graphics offload.

  • get_loop ()

    Returns %TRUE if videos have been set to loop.

  • get_media_stream ()

    Gets the media stream managed by @self or %NULL if none.

  • set_autoplay (bool autoplay)

    Sets whether @self automatically starts playback when it becomes visible or when a new file gets loaded.

    • @p autoplay is whether media streams should autoplay.
    • @r None.
  • set_file (object file)

    Makes @self play the given @file.

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

    Makes @self play the given @filename. This is a utility function that calls gtk_video_set_file(),

    • @p filename is the filename to play.
    • @r None.
  • set_graphics_offload (string enabled)

    Sets whether to enable graphics offload. See [class@Gtk.GraphicsOffload] for more information on graphics offload.

    • @p enabled is the new graphics offload status.
    • @r None.
  • set_loop (bool loop)

    Sets whether new files loaded by @self should be set to loop.

    • @p loop is whether media streams should loop.
    • @r None.
  • set_media_stream (object stream)

    Sets the media stream to be played back. @self will take full control of managing the media stream. If you want to manage a media stream yourself, consider using a [class@Gtk.Picture] for display. If you want to display a file, consider using [method@Gtk.Video.set_file] instead.

    • @p stream is The media stream to play or %NULL to unset.
    • @r None.
  • set_resource (string resource_path)

    Makes @self play the resource at the given @resource_path. This is a utility function that calls [method@Gtk.Video.set_file].

    • @p resource_path is the resource to set.
    • @r None.

class: VideoCtors

[347:14] static extends: object

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

Methods

  • newForFile (object file)

    Creates a GtkVideo to play back the given @file.

    • @p file is a GFile.
    • @r A new Video.
  • newForFilename (string filename)

    Creates a GtkVideo to play back the given @filename. This is a utility function that calls [ctor@Gtk.Video.new_for_file], See that function for details.

    • @p filename is filename to play back.
    • @r A new Video.
  • newForMediaStream (object stream)

    Creates a GtkVideo to play back the given @stream.

    • @p stream is a GtkMediaStream.
    • @r A new Video.
  • newForResource (string resource_path)

    Creates a GtkVideo to play back the resource at the given

    • @resource_path. This is a utility function that calls [ctor@Gtk.Video.new_for_file].
    • @p resource_path is resource path to play back.
    • @r A new Video.

class: VideoMeta

[405:14] static extends: object

Generated metadata helpers for Video class surfaces.

Methods

  • properties ()

    Returns property metadata for Video.

    • @r A list.