gtk.video
Module for [Video] class
Types 3
classVideo : gtk.widget.Widget
[gtk.video.Video] is a widget to show a [gtk.media_stream.MediaStream] with media controls.
The controls are available separately as [gtk.media_controls.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 [gtk.picture.Picture].
[gtk.video.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 [gdk.paintable.Paintable] API and a media framework such as Gstreamer directly.
Methods
VideoGidBuilder builder()Get builder for [gtk.video.Video] Returns: New builder objectbool autoplay() @propertyGet `autoplay` property. Returns: If the video should automatically begin playing.void autoplay(bool propval) @propertySet `autoplay` property. Params: propval = If the video should automatically begin playing.gio.file.File file() @propertyGet `file` property. Returns: The file played by this video if the video is playing a file.void file(gio.file.File propval) @propertySet `file` property. Params: propval = The file played by this video if the video is playing a file.gtk.types.GraphicsOffloadEnabled graphicsOffload() @propertyGet `graphicsOffload` property. Returns: Whether to enable graphics offload.void graphicsOffload(gtk.types.GraphicsOffloadEnabled propval) @propertySet `graphicsOffload` property. Params: propval = Whether to enable graphics offload.void loop(bool propval) @propertySet `loop` property. Params: propval = If new media files should be set to loop.gtk.media_stream.MediaStream mediaStream() @propertyGet `mediaStream` property. Returns: The media-stream playedvoid mediaStream(gtk.media_stream.MediaStream propval) @propertySet `mediaStream` property. Params: propval = The media-stream playedgtk.video.Video newForFile(gio.file.File file = null)Creates a [gtk.video.Video] to play back the given file.gtk.video.Video newForFilename(string filename = null)Creates a [gtk.video.Video] to play back the given filename.gtk.video.Video newForMediaStream(gtk.media_stream.MediaStream stream = null)Creates a [gtk.video.Video] to play back the given stream.gtk.video.Video newForResource(string resourcePath = null)Creates a [gtk.video.Video] to play back the resource at the given resource_path.bool getAutoplay()Returns true if videos have been set to loop. Returns: true if streams should autoplaygio.file.File getFile()Gets the file played by self or null if not playing back a file. Returns: The file played by selfgtk.types.GraphicsOffloadEnabled getGraphicsOffload()Returns whether graphics offload is enabled.bool getLoop()Returns true if videos have been set to loop. Returns: true if streams should loopgtk.media_stream.MediaStream getMediaStream()Gets the media stream managed by self or null if none. Returns: The media stream managed by selfvoid setAutoplay(bool autoplay)Sets whether self automatically starts playback when it becomes visible or when a new file gets loaded.void setFile(gio.file.File file = null)Makes self play the given file.void setFilename(string filename = null)Makes self play the given filename.void setGraphicsOffload(gtk.types.GraphicsOffloadEnabled enabled)Sets whether to enable graphics offload.void setLoop(bool loop)Sets whether new files loaded by self should be set to loop.void setMediaStream(gtk.media_stream.MediaStream stream = null)Sets the media stream to be played back.void setResource(string resourcePath = null)Makes self play the resource at the given resource_path.classVideoGidBuilderImpl(T) : gtk.widget.WidgetGidBuilderImpl!T
Methods
T autoplay(bool propval)Set `autoplay` property. Params: propval = If the video should automatically begin playing. Returns: Builder instance for fluent chainingT file(gio.file.File propval)Set `file` property. Params: propval = The file played by this video if the video is playing a file. Returns: Builder instance for fluent chainingT graphicsOffload(gtk.types.GraphicsOffloadEnabled propval)Set `graphicsOffload` property. Params: propval = Whether to enable graphics offload. Returns: Builder instance for fluent chainingT loop(bool propval)Set `loop` property. Params: propval = If new media files should be set to loop. Returns: Builder instance for fluent chainingT mediaStream(gtk.media_stream.MediaStream propval)Set `mediaStream` property. Params: propval = The media-stream played Returns: Builder instance for fluent chaining