Class: Gtk::MediaFile

Inherits:
MediaStream show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from MediaStream

#duration, #duration=, #ended, #ended=, #ended?, #error, #error=, #error_valist, #gerror, #has_audio, #has_audio=, #has_audio?, #has_video, #has_video=, #has_video?, #is_prepared, #is_seekable, #is_seeking, #loop, #loop=, #loop?, #muted, #muted=, #muted?, #pause, #play, #playing, #playing=, #playing?, #prepared, #prepared=, #prepared?, #realize, #seek, #seek_failed, #seek_success, #seekable=, #seekable?, #seeking=, #seeking?, #stream_ended, #stream_prepared, #stream_unprepared, #timestamp, #timestamp=, #unprepared, #unrealize, #update, #volume, #volume=

Constructor Details

#initialize(resource_path) ⇒ Gtk::MediaFile

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 [ctorGtk.MediaFile.new_for_file].

Parameters:

  • resource_path (String)

    resource path to open

Instance Method Details

#clearnil

Resets the media file to be empty.

Returns:

  • (nil)

#fileGio::File

The file being played back or nil if not playing a file.

Returns:

  • (Gio::File)

    file

#file=(file) ⇒ Gio::File

The file being played back or nil if not playing a file.

Parameters:

  • file (Gio::File)

Returns:

  • (Gio::File)

    file

  • (Gio::File)

    file

#filename=(filename) ⇒ nil

Sets the `GtkMediaFile to play the given file.

This is a utility function that converts the given filename to a GFile and calls [methodGtk.MediaFile.set_file].

Parameters:

  • filename (Gtk::filename)

    name of file to play

Returns:

  • (nil)

#input_streamGio::InputStream

The stream being played back or nil if not playing a stream.

This is nil when playing a file.

Returns:

  • (Gio::InputStream)

    input-stream

#input_stream=(input_stream) ⇒ Gio::InputStream

The stream being played back or nil if not playing a stream.

This is nil when playing a file.

Parameters:

  • input_stream (Gio::InputStream)

Returns:

  • (Gio::InputStream)

    input-stream

  • (Gio::InputStream)

    input-stream

#resource=(resource_path) ⇒ nil

Sets the `GtkMediaFile to play the given resource.

This is a utility function that converts the given resource_path to a GFile and calls [methodGtk.MediaFile.set_file].

Parameters:

  • resource_path (String)

    path to resource to play

Returns:

  • (nil)