Top |
Functions
GtkWidget * | gtk_video_new () |
GtkWidget * | gtk_video_new_for_media_stream () |
GtkWidget * | gtk_video_new_for_file () |
GtkWidget * | gtk_video_new_for_filename () |
GtkWidget * | gtk_video_new_for_resource () |
GtkMediaStream * | gtk_video_get_media_stream () |
void | gtk_video_set_media_stream () |
GFile * | gtk_video_get_file () |
void | gtk_video_set_file () |
void | gtk_video_set_filename () |
void | gtk_video_set_resource () |
gboolean | gtk_video_get_autoplay () |
void | gtk_video_set_autoplay () |
gboolean | gtk_video_get_loop () |
void | gtk_video_set_loop () |
Properties
gboolean | autoplay | Read / Write |
GFile * | file | Read / Write |
gboolean | loop | Read / Write |
GtkMediaStream * | media-stream | Read / Write |
Description
GtkVideo is a widget to show a GtkMediaStream with media controls as provided by 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.
Functions
gtk_video_new_for_media_stream ()
GtkWidget *
gtk_video_new_for_media_stream (GtkMediaStream *stream
);
Creates a GtkVideo to play back the given stream
.
gtk_video_new_for_file ()
GtkWidget *
gtk_video_new_for_file (GFile *file
);
Creates a GtkVideo to play back the given file
.
gtk_video_new_for_filename ()
GtkWidget *
gtk_video_new_for_filename (const char *filename
);
Creates a GtkVideo to play back the given filename
.
This is a utility function that calls gtk_video_new_for_file()
,
See that function for details.
gtk_video_new_for_resource ()
GtkWidget *
gtk_video_new_for_resource (const char *resource_path
);
Creates a GtkVideo to play back the resource at the
given resource_path
.
This is a utility function that calls gtk_video_new_for_file()
,
gtk_video_get_media_stream ()
GtkMediaStream *
gtk_video_get_media_stream (GtkVideo *self
);
Gets the media stream managed by self
or NULL
if none.
gtk_video_set_media_stream ()
void gtk_video_set_media_stream (GtkVideo *self
,GtkMediaStream *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 GtkImage for display.
If you want to display a file, consider using gtk_video_set_file()
instead.
gtk_video_get_file ()
GFile *
gtk_video_get_file (GtkVideo *self
);
Gets the file played by self
or NULL
if not playing back
a file.
gtk_video_set_file ()
void gtk_video_set_file (GtkVideo *self
,GFile *file
);
Makes self
play the given file
.
gtk_video_set_filename ()
void gtk_video_set_filename (GtkVideo *self
,const char *filename
);
Makes self
play the given filename
.
This is a utility function that calls gtk_video_set_file()
,
gtk_video_set_resource ()
void gtk_video_set_resource (GtkVideo *self
,const char *resource_path
);
Makes self
play the resource at the given resource_path
.
This is a utility function that calls gtk_video_set_file()
,
gtk_video_get_autoplay ()
gboolean
gtk_video_get_autoplay (GtkVideo *self
);
Returns TRUE
if videos have been set to loop via gtk_video_set_loop()
.
gtk_video_set_autoplay ()
void gtk_video_set_autoplay (GtkVideo *self
,gboolean autoplay
);
Sets whether self
automatically starts playback when it becomes visible
or when a new file gets loaded.
gtk_video_get_loop ()
gboolean
gtk_video_get_loop (GtkVideo *self
);
Returns TRUE
if videos have been set to loop via gtk_video_set_loop()
.
Property Details
The “autoplay”
property
“autoplay” gboolean
If the video should automatically begin playing.
Owner: GtkVideo
Flags: Read / Write
Default value: FALSE
The “file”
property
“file” GFile *
The file played by this video if the video is playing a file.
Owner: GtkVideo
Flags: Read / Write
The “loop”
property
“loop” gboolean
If new media files should be set to loop.
Owner: GtkVideo
Flags: Read / Write
Default value: FALSE
The “media-stream”
property
“media-stream” GtkMediaStream *
The media-stream played
Owner: GtkVideo
Flags: Read / Write