gtk.video

Module for [Video] class

Types 3

gtk.video.Video is a widget to show a gtk.media_stream.MediaStream with media controls.

!An example GtkVideo

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
GType _getGType() static nothrow
GType _gType() @property nothrow
Video self() nothrowReturns `this`, for use in `with` statements.
VideoGidBuilder builder() static nothrowGet builder for [gtk.video.Video] Returns: New builder object
bool autoplay() @property nothrowGet `autoplay` property. Returns: If the video should automatically begin playing.
void autoplay(bool propval) @property nothrowSet `autoplay` property. Params: propval = If the video should automatically begin playing.
gio.file.File file() @property nothrowGet `file` property. Returns: The file played by this video if the video is playing a file.
void file(gio.file.File propval) @property nothrowSet `file` property. Params: propval = The file played by this video if the video is playing a file.
gtk.types.GraphicsOffloadEnabled graphicsOffload() @property nothrowGet `graphicsOffload` property. Returns: Whether to enable graphics offload.
void graphicsOffload(gtk.types.GraphicsOffloadEnabled propval) @property nothrowSet `graphicsOffload` property. Params: propval = Whether to enable graphics offload.
bool loop() @property nothrowGet `loop` property. Returns: If new media files should be set to loop.
void loop(bool propval) @property nothrowSet `loop` property. Params: propval = If new media files should be set to loop.
gtk.media_stream.MediaStream mediaStream() @property nothrowGet `mediaStream` property. Returns: The media-stream played
void mediaStream(gtk.media_stream.MediaStream propval) @property nothrowSet `mediaStream` property. Params: propval = The media-stream played
gtk.video.Video newForFile(gio.file.File file = null) static nothrowCreates a [gtk.video.Video] to play back the given file.
gtk.video.Video newForFilename(string filename = null) static nothrowCreates a [gtk.video.Video] to play back the given filename.
gtk.video.Video newForMediaStream(gtk.media_stream.MediaStream stream = null) static nothrowCreates a [gtk.video.Video] to play back the given stream.
gtk.video.Video newForResource(string resourcePath = null) static nothrowCreates a [gtk.video.Video] to play back the resource at the given resource_path.
bool getAutoplay() nothrowReturns true if videos have been set to loop. Returns: true if streams should autoplay
gio.file.File getFile() nothrowGets the file played by self or null if not playing back a file. Returns: The file played by self
gtk.types.GraphicsOffloadEnabled getGraphicsOffload() nothrowReturns whether graphics offload is enabled.
bool getLoop() nothrowReturns true if videos have been set to loop. Returns: true if streams should loop
gtk.media_stream.MediaStream getMediaStream() nothrowGets the media stream managed by self or null if none. Returns: The media stream managed by self
void setAutoplay(bool autoplay) nothrowSets whether self automatically starts playback when it becomes visible or when a new file gets loaded.
void setFile(gio.file.File file = null) nothrowMakes self play the given file.
void setFilename(string filename = null) nothrowMakes self play the given filename.
void setGraphicsOffload(gtk.types.GraphicsOffloadEnabled enabled) nothrowSets whether to enable graphics offload.
void setLoop(bool loop) nothrowSets whether new files loaded by self should be set to loop.
void setMediaStream(gtk.media_stream.MediaStream stream = null) nothrowSets the media stream to be played back.
void setResource(string resourcePath = null) nothrowMakes self play the resource at the given resource_path.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new empty [gtk.video.Video]. Returns: a new [gtk.video.Video]

Fluent builder implementation template for gtk.video.Video

Methods
T autoplay(bool propval) nothrowSet `autoplay` property. Params: propval = If the video should automatically begin playing. Returns: Builder instance for fluent chaining
T file(gio.file.File propval) nothrowSet `file` property. Params: propval = The file played by this video if the video is playing a file. Returns: Builder instance for fluent chaining
T graphicsOffload(gtk.types.GraphicsOffloadEnabled propval) nothrowSet `graphicsOffload` property. Params: propval = Whether to enable graphics offload. Returns: Builder instance for fluent chaining
T loop(bool propval) nothrowSet `loop` property. Params: propval = If new media files should be set to loop. Returns: Builder instance for fluent chaining
T mediaStream(gtk.media_stream.MediaStream propval) nothrowSet `mediaStream` property. Params: propval = The media-stream played Returns: Builder instance for fluent chaining

Fluent builder for gtk.video.Video

Methods
Video build() nothrowCreate object from builder. Returns: New object