Video
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
- Constructors:
Video(**properties)
new() -> Gtk.Widget
new_for_file(file:Gio.File=None) -> Gtk.Widget
new_for_filename(filename:str=None) -> Gtk.Widget
new_for_media_stream(stream:Gtk.MediaStream=None) -> Gtk.Widget
new_for_resource(resource_path:str=None) -> Gtk.Widget
Constructors
- class Video
-
- classmethod new_for_file(file: File | None = None) Widget
Creates a
GtkVideo
to play back the givenfile
.- Parameters:
file – a
GFile
- classmethod new_for_filename(filename: str | None = None) Widget
Creates a
GtkVideo
to play back the givenfilename
.This is a utility function that calls
new_for_file
, See that function for details.- Parameters:
filename – filename to play back
- classmethod new_for_media_stream(stream: MediaStream | None = None) Widget
Creates a
GtkVideo
to play back the givenstream
.- Parameters:
stream – a
GtkMediaStream
- classmethod new_for_resource(resource_path: str | None = None) Widget
Creates a
GtkVideo
to play back the resource at the givenresource_path
.This is a utility function that calls
new_for_file
.- Parameters:
resource_path – resource path to play back
Methods
- class Video
-
- get_graphics_offload() GraphicsOffloadEnabled
Returns whether graphics offload is enabled.
See
GraphicsOffload
for more information on graphics offload.Added in version 4.14.
- get_media_stream() MediaStream | None
Gets the media stream managed by
self
orNone
if none.
- set_autoplay(autoplay: bool) None
Sets whether
self
automatically starts playback when it becomes visible or when a new file gets loaded.- Parameters:
autoplay – whether media streams should autoplay
- set_file(file: File | None = None) None
Makes
self
play the givenfile
.- Parameters:
file – the file to play
- set_filename(filename: str | None = None) None
Makes
self
play the givenfilename
.This is a utility function that calls
set_file()
,- Parameters:
filename – the filename to play
- set_graphics_offload(enabled: GraphicsOffloadEnabled) None
Sets whether to enable graphics offload.
See
GraphicsOffload
for more information on graphics offload.Added in version 4.14.
- Parameters:
enabled – the new graphics offload status
- set_loop(loop: bool) None
Sets whether new files loaded by
self
should be set to loop.- Parameters:
loop – whether media streams should loop
- set_media_stream(stream: MediaStream | None = None) None
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 aPicture
for display.If you want to display a file, consider using
set_file
instead.- Parameters:
stream – The media stream to play or
None
to unset
Properties
- class Video
-
- props.graphics_offload: GraphicsOffloadEnabled
Whether to enable graphics offload.
Added in version 4.14.
- props.media_stream: MediaStream
The media-stream played