1.119 <GtkMediaFile>

Class: <GtkMediaFile>

It derives from <GtkMediaStream>.

Implements the <GtkMediaStream> interface for files.

This provides a simple way to play back video files with GTK.

GTK provides a GIO extension point for <GtkMediaFile> implementations to allow for external implementations using various media frameworks.

GTK itself includes an implementation using GStreamer.

Fields

parent-instance

Properties

Property: media-file:file self

The file being played back or #f if not playing a file.

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

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

Property: media-file:input-stream self

The stream being played back or #f if not playing a stream.

This is #f when playing a file.

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

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

Procedures

Method: media-file:clear self
Method: clear self

Resets the media file to be empty.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

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

Returns the file that self is currently playing from.

When self is not playing or not playing from a file, #f is returned.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

%return

Returned: a <GFile>, or #f.

The currently playing file

Method: media-file:get-input-stream self ⇒ %return
Method: get-input-stream self ⇒ %return

Returns the stream that self is currently playing from.

When self is not playing or not playing from a stream, #f is returned.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

%return

Returned: a <GInputStream>, or #f.

The currently playing stream

Procedure: media-file:new ⇒ %return

Creates a new empty media file.

%return

Returned: a <GtkMediaFile>.

a new <GtkMediaFile>

Procedure: media-file:new-for-file file ⇒ %return

Creates a new media file to play file.

file

Passed: a <GFile>.

The file to play

%return

Returned: a <GtkMediaFile>.

a new <GtkMediaFile> playing file

Procedure: media-file:new-for-filename filename ⇒ %return

Creates a new media file for the given filename.

This is a utility function that converts the given filename to a <GFile> and calls media-file:new-for-file.

filename

Passed: a file name, as a string.

filename to open

%return

Returned: a <GtkMediaFile>.

a new <GtkMediaFile> playing filename

Procedure: media-file:new-for-input-stream stream ⇒ %return

Creates a new media file to play stream.

If you want the resulting media to be seekable, the stream should implement the <GSeekable> interface.

stream

Passed: a <GInputStream>.

The stream to play

%return

Returned: a <GtkMediaFile>.

a new <GtkMediaFile>

Procedure: media-file:new-for-resource resource-path ⇒ %return

Creates a new new media file for the given resource.

This is a utility function that converts the given resource to a <GFile> and calls media-file:new-for-file.

resource-path

Passed: a string.

resource path to open

%return

Returned: a <GtkMediaFile>.

a new <GtkMediaFile> playing resource-path

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

Sets the <GtkMediaFile> to play the given file.

If any file is still playing, stop playing it.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

file

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

the file to play

Method: media-file:set-filename self [filename]
Method: set-filename self [filename]

Sets the <GtkMediaFile> to play the given file.

This is a utility function that converts the given filename to a <GFile> and calls media-file:set-file.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

filename

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

name of file to play

Method: media-file:set-input-stream self [stream]
Method: set-input-stream self [stream]

Sets the <GtkMediaFile> to play the given stream.

If anything is still playing, stop playing it.

Full control about the stream is assumed for the duration of playback. The stream will not be closed.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

stream

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

the stream to play from

Method: media-file:set-resource self [resource-path]
Method: set-resource self [resource-path]

Sets the <GtkMediaFile> to play the given resource.

This is a utility function that converts the given resource-path to a <GFile> and calls media-file:set-file.

self

Passed: a <GtkMediaFile>.

a <GtkMediaFile>

resource-path

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

path to resource to play

Virtual methods

Virtual method: media-file:do-close implementor self

To override it in a new class, give register-type #:vfuncs `((close . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkMediaFile>, or a class that derives from it, or its GType number.

self

Passed: a <GtkMediaFile>.

Virtual method: media-file:do-open implementor self

To override it in a new class, give register-type #:vfuncs `((open . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkMediaFile>, or a class that derives from it, or its GType number.

self

Passed: a <GtkMediaFile>.