MediaFile

GtkMediaFile implements GtkMediaStream 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 implementations using GStreamer and ffmpeg.

Constructors

this
this(GtkMediaFile* gtkMediaFile, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new empty media file.

this
this(FileIF file)

Creates a new media file to play @file.

this
this(string filename)

Creates a new media file for the given filename.

this
this(InputStream stream)

Creates a new media file to play @stream.

Members

Functions

clear
void clear()

Resets the media file to be empty.

getFile
FileIF getFile()

Returns the file that @self is currently playing from.

getInputStream
InputStream getInputStream()

Returns the stream that @self is currently playing from.

getMediaFileStruct
GtkMediaFile* getMediaFileStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setFile
void setFile(FileIF file)

Sets the GtkMediaFile to play the given file.

setFilename
void setFilename(string filename)

Sets the `GtkMediaFile to play the given file.

setInputStream
void setInputStream(InputStream stream)

Sets the GtkMediaFile to play the given stream.

setResource
void setResource(string resourcePath)

Sets the `GtkMediaFile to play the given resource.

Static functions

getType
GType getType()

Variables

gtkMediaFile
GtkMediaFile* gtkMediaFile;

the main Gtk struct

Inherited Members

From MediaStream

gtkMediaStream
GtkMediaStream* gtkMediaStream;

the main Gtk struct

getMediaStreamStruct
GtkMediaStream* getMediaStreamStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

__anonymous
mixin PaintableT!(GtkMediaStream)
Undocumented in source.
getType
GType getType()
ended
void ended()

Pauses the media stream and marks it as ended.

errorValist
void errorValist(GQuark domain, int code, string format, void* args)

Sets @self into an error state using a printf()-style format string.

gerror
void gerror(ErrorG error)

Sets @self into an error state.

getDuration
long getDuration()

Gets the duration of the stream.

getEnded
bool getEnded()

Returns whether the streams playback is finished.

getError
ErrorG getError()

If the stream is in an error state, returns the GError explaining that state.

getLoop
bool getLoop()

Returns whether the stream is set to loop.

getMuted
bool getMuted()

Returns whether the audio for the stream is muted.

getPlaying
bool getPlaying()

Return whether the stream is currently playing.

getTimestamp
long getTimestamp()

Returns the current presentation timestamp in microseconds.

getVolume
double getVolume()

Returns the volume of the audio for the stream.

hasAudio
bool hasAudio()

Returns whether the stream has audio.

hasVideo
bool hasVideo()

Returns whether the stream has video.

isPrepared
bool isPrepared()

Returns whether the stream has finished initializing.

isSeekable
bool isSeekable()

Checks if a stream may be seekable.

isSeeking
bool isSeeking()

Checks if there is currently a seek operation going on.

pause
void pause()

Pauses playback of the stream.

play
void play()

Starts playing the stream.

prepared
void prepared(bool hasAudio, bool hasVideo, bool seekable, long duration)

Called by GtkMediaStream implementations to advertise the stream being ready to play and providing details about the stream.

realize
void realize(Surface surface)

Called by users to attach the media stream to a GdkSurface they manage.

seek
void seek(long timestamp)

Start a seek operation on @self to @timestamp.

seekFailed
void seekFailed()

Ends a seek operation started via GtkMediaStream.seek() as a failure.

seekSuccess
void seekSuccess()

Ends a seek operation started via GtkMediaStream.seek() successfully.

setLoop
void setLoop(bool loop)

Sets whether the stream should loop.

setMuted
void setMuted(bool muted)

Sets whether the audio stream should be muted.

setPlaying
void setPlaying(bool playing)

Starts or pauses playback of the stream.

setVolume
void setVolume(double volume)

Sets the volume of the audio stream.

unprepared
void unprepared()

Resets a given media stream implementation.

unrealize
void unrealize(Surface surface)

Undoes a previous call to gtk_media_stream_realize().

update
void update(long timestamp)

Media stream implementations should regularly call this function to update the timestamp reported by the stream.

Meta