Basics
Guides
API Reference
Basics
Guides
API Reference
[23:7] extends: object
Shows a GtkMediaStream with media controls.
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.
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 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.asWidget ()
Wraps this handle as
Widget.
A Widget object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
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.
Value is the new property value.None.setFile (object Value)
The file played by this video if the video is playing a file.
Value is the new property value.None.setGraphicsoffload (string Value)
Whether to enable graphics offload.
Value is the new property value.None.setLoop (bool Value)
If new media files should be set to loop.
Value is the new property value.None.setMediastream (object Value)
The media-stream played
Value is the new property value.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.
autoplay is whether media streams should autoplay.None.set_file (object file)
Makes @self play the given @file.
file is the file to play.None.set_filename (string filename)
Makes @self play the given @filename. This is a utility function that calls gtk_video_set_file(),
filename is the filename to play.None.set_graphics_offload (string enabled)
Sets whether to enable graphics offload. See [class@Gtk.GraphicsOffload] for more information on graphics offload.
enabled is the new graphics offload status.None.set_loop (bool loop)
Sets whether new files loaded by @self should be set to loop.
loop is whether media streams should loop.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.
stream is The media stream to play or %NULL to unset.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].
resource_path is the resource to set.None.[347:14] static extends: object
Alternate constructors for Video. Usage:
VideoCtors.<name>(...). The primary constructor lives
directly on Video.
newForFile (object file)
Creates a
GtkVideoto play back the given @file.
file is a GFile.A new Video.newForFilename (string filename)
Creates a
GtkVideoto play back the given @filename. This is a utility function that calls [ctor@Gtk.Video.new_for_file], See that function for details.
filename is filename to play back.A new Video.newForMediaStream (object stream)
Creates a
GtkVideoto play back the given @stream.
stream is a GtkMediaStream.A new Video.newForResource (string resource_path)
Creates a
GtkVideoto play back the resource at the given
This is a utility function that calls [ctor@Gtk.Video.new_for_file].resource_path is resource path to play back.A new Video.[405:14] static extends: object
Generated metadata helpers for Video class surfaces.
properties ()
Returns property metadata for
Video.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.