Gnome::Gtk4::Video
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Description
Gnome::Gtk4::Video is a widget to show a Gnome::Gtk4::MediaStream with media controls.
The controls are available separately as Gnome::Gtk4::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 Gnome::Gtk4::Picture.
Gnome::Gtk4::Video 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 Gnome::Gdk4::R-Paintable API and a media framework such as Gstreamer directly.
Uml Diagram
=end rakudoc
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-video
Creates a new empty Gnome::Gtk4::Video.
method new-video ( --> Gnome::Gtk4::Video )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-for-file
Creates a Gnome::Gtk4::Video to play back the given $file.
method new-for-file ( N-Object() $file --> Gnome::Gtk4::Video )
$file; a Gnome::Gio::R-File.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-for-filename
Creates a Gnome::Gtk4::Video to play back the given $filename.
This is a utility function that calls .new-for-file(), See that function for details.
method new-for-filename ( Str $filename --> Gnome::Gtk4::Video )
$filename; filename to play back.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-for-media-stream
Creates a Gnome::Gtk4::Video to play back the given $stream.
method new-for-media-stream ( N-Object() $stream --> Gnome::Gtk4::Video )
$stream; a Gnome::Gtk4::MediaStream.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-for-resource
Creates a Gnome::Gtk4::Video to play back the resource at the
given $resource-path.
This is a utility function that calls .new-for-file().
method new-for-resource ( Str $resource-path --> Gnome::Gtk4::Video )
$resource-path; resource path to play back.
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-autoplay
Returns True if videos have been set to loop.
method get-autoplay (--> Bool )
Return value; True if streams should autoplay.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-file
Gets the file played by $self or undefined if not playing back
a file.
method get-file (--> N-Object )
Return value; The file played by $self.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-graphics-offload This function is not yet available
Returns whether graphics offload is enabled.
See Gnome::Gtk4::GraphicsOffload for more information on graphics offload.
method get-graphics-offload (--> GtkGraphicsOffloadEnabled )
Return value; the graphics offload status.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-loop
Returns True if videos have been set to loop.
method get-loop (--> Bool )
Return value; True if streams should loop.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-media-stream
Gets the media stream managed by $self or undefined if none.
method get-media-stream (--> N-Object )
Return value; The media stream managed by $self.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-autoplay
Sets whether $self automatically starts playback when it
becomes visible or when a new file gets loaded.
method set-autoplay ( Bool() $autoplay )
$autoplay; whether media streams should autoplay.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-file
Makes $self play the given $file.
method set-file ( N-Object() $file )
$file; the file to play.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-filename
Makes $self play the given $filename.
This is a utility function that calls .set-file(),
method set-filename ( Str $filename )
$filename; the filename to play.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-graphics-offload
Sets whether to enable graphics offload.
See Gnome::Gtk4::GraphicsOffload for more information on graphics offload.
method set-graphics-offload ( GtkGraphicsOffloadEnabled $enabled )
$enabled; the new graphics offload status.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-loop
Sets whether new files loaded by $self should be set to loop.
method set-loop ( Bool() $loop )
$loop; whether media streams should loop.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-media-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
Gnome::Gtk4::Picture for display.
If you want to display a file, consider using .set-file() instead.
method set-media-stream ( N-Object() $stream )
$stream; The media stream to play or undefined to unset.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-resource
Makes $self play the resource at the given $resource-path.
This is a utility function that calls .set-file().
method set-resource ( Str $resource-path )
$resource-path; the resource to set.
=end rakudoc