1.212 <GtkVideo>

Class: <GtkVideo>

It derives from <GtkWidget>.

Shows a <GtkMediaStream> with media controls.

The controls are available separately as <GtkMediaControls>. 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 <GtkPicture>.

<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 <GdkPaintable> API and a media framework such as Gstreamer directly.

Properties

Property: video:autoplay self

If the video should automatically begin playing.

Its value is a boolean.

Set it with (set! (video:autoplay self) value).

Property: video:file self

The file played by this video if the video is playing a file.

Its value is a <GFile>, or #f.

Set it with (set! (video:file self) value).

Property: video:graphics-offload self

Whether to enable graphics offload.

Its value is a <GtkGraphicsOffloadEnabled> (or, to set it, one of its symbols).

Set it with (set! (video:graphics-offload self) value).

Property: video:loop self

If new media files should be set to loop.

Its value is a boolean.

Set it with (set! (video:loop self) value).

Property: video:media-stream self

The media-stream played

Its value is a <GtkMediaStream>, or #f.

Set it with (set! (video:media-stream self) value).

Procedures

Method: video:get-autoplay? self ⇒ %return
Method: get-autoplay? self ⇒ %return

Returns #t if videos have been set to loop.

self

Passed: a <GtkVideo>.

a <GtkVideo>

%return

Returned: a boolean.

#t if streams should autoplay

Method: video:get-file self ⇒ %return
Method: get-file self ⇒ %return

Gets the file played by self or #f if not playing back a file.

self

Passed: a <GtkVideo>.

a <GtkVideo>

%return

Returned: a <GFile>, or #f.

The file played by self

Method: video:get-graphics-offload self ⇒ %return
Method: get-graphics-offload self ⇒ %return

Returns whether graphics offload is enabled.

See <GtkGraphicsOffload> for more information on graphics offload.

self

Passed: a <GtkVideo>.

a <GtkVideo>

%return

Returned: a <GtkGraphicsOffloadEnabled>.

the graphics offload status

Method: video:get-loop? self ⇒ %return
Method: get-loop? self ⇒ %return

Returns #t if videos have been set to loop.

self

Passed: a <GtkVideo>.

a <GtkVideo>

%return

Returned: a boolean.

#t if streams should loop

Method: video:get-media-stream self ⇒ %return
Method: get-media-stream self ⇒ %return

Gets the media stream managed by self or #f if none.

self

Passed: a <GtkVideo>.

a <GtkVideo>

%return

Returned: a <GtkMediaStream>, or #f.

The media stream managed by self

Procedure: video:new ⇒ %return

Creates a new empty <GtkVideo>.

%return

Returned: a <GtkWidget>.

a new <GtkVideo>

Procedure: video:new-for-file [file] ⇒ %return

Creates a <GtkVideo> to play back the given file.

file

Passed, or left out: a <GFile>, or #f.

a <GFile>

%return

Returned: a <GtkWidget>.

a new <GtkVideo>

Procedure: video:new-for-filename [filename] ⇒ %return

Creates a <GtkVideo> to play back the given filename.

This is a utility function that calls video:new-for-file, See that function for details.

filename

Passed, or left out: a file name, as a string, or #f.

filename to play back

%return

Returned: a <GtkWidget>.

a new <GtkVideo>

Procedure: video:new-for-media-stream [stream] ⇒ %return

Creates a <GtkVideo> to play back the given stream.

stream

Passed, or left out: a <GtkMediaStream>, or #f.

a <GtkMediaStream>

%return

Returned: a <GtkWidget>.

a new <GtkVideo>

Procedure: video:new-for-resource [resource-path] ⇒ %return

Creates a <GtkVideo> to play back the resource at the given resource-path.

This is a utility function that calls video:new-for-file.

resource-path

Passed, or left out: a string, or #f.

resource path to play back

%return

Returned: a <GtkWidget>.

a new <GtkVideo>

Method: video:set-autoplay self autoplay
Method: set-autoplay self autoplay

Sets whether self automatically starts playback when it becomes visible or when a new file gets loaded.

self

Passed: a <GtkVideo>.

a <GtkVideo>

autoplay

Passed: a boolean.

whether media streams should autoplay

Method: video:set-file self [file]
Method: set-file self [file]

Makes self play the given file.

self

Passed: a <GtkVideo>.

a <GtkVideo>

file

Passed, or left out: a <GFile>, or #f.

the file to play

Method: video:set-filename self [filename]
Method: set-filename self [filename]

Makes self play the given filename.

This is a utility function that calls video:set-file,

self

Passed: a <GtkVideo>.

a <GtkVideo>

filename

Passed, or left out: a file name, as a string, or #f.

the filename to play

Method: video:set-graphics-offload self enabled
Method: set-graphics-offload self enabled

Sets whether to enable graphics offload.

See <GtkGraphicsOffload> for more information on graphics offload.

self

Passed: a <GtkVideo>.

a <GtkVideo>

enabled

Passed: a <GtkGraphicsOffloadEnabled>, or one of its symbols.

the new graphics offload status

Method: video:set-loop self loop
Method: set-loop self loop

Sets whether new files loaded by self should be set to loop.

self

Passed: a <GtkVideo>.

a <GtkVideo>

loop

Passed: a boolean.

whether media streams should loop

Method: video:set-media-stream self [stream]
Method: set-media-stream self [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 <GtkPicture> for display.

If you want to display a file, consider using video:set-file instead.

self

Passed: a <GtkVideo>.

a <GtkVideo>

stream

Passed, or left out: a <GtkMediaStream>, or #f.

The media stream to play or #f to unset

Method: video:set-resource self [resource-path]
Method: set-resource self [resource-path]

Makes self play the resource at the given resource-path.

This is a utility function that calls video:set-file.

self

Passed: a <GtkVideo>.

a <GtkVideo>

resource-path

Passed, or left out: a string, or #f.

the resource to set