pub trait MediaFileExt: 'static {
    fn clear(&self);
    fn file(&self) -> Option<File>;
    fn input_stream(&self) -> Option<InputStream>;
    fn set_file(&self, file: Option<&impl IsA<File>>);
    fn set_filename(&self, filename: Option<impl AsRef<Path>>);
    fn set_input_stream(&self, stream: Option<&impl IsA<InputStream>>);
    fn set_resource(&self, resource_path: Option<&str>);
    fn connect_file_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_input_stream_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }
Expand description

Trait containing all MediaFile methods.

Implementors

MediaFile

Required Methods§

Resets the media file to be empty.

Returns the file that @self is currently playing from.

When @self is not playing or not playing from a file, None is returned.

Returns

The currently playing file

Returns the stream that @self is currently playing from.

When @self is not playing or not playing from a stream, None is returned.

Returns

The currently playing stream

Sets the MediaFile to play the given file.

If any file is still playing, stop playing it.

file

the file to play

Sets the `GtkMediaFile to play the given file.

This is a utility function that converts the given @filename to a GFile and calls set_file().

filename

name of file to play

Sets the MediaFile 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.

stream

the stream to play from

Sets the `GtkMediaFile to play the given resource.

This is a utility function that converts the given @resource_path to a GFile and calls set_file().

resource_path

path to resource to play

Implementors§