GtkVideo — A widget for displaying video
| 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 () |
| gboolean | autoplay | Read / Write |
| GFile * | file | Read / Write |
| gboolean | loop | Read / Write |
| GtkMediaStream * | media-stream | Read / Write |
GObject
╰── GInitiallyUnowned
╰── GtkWidget
╰── GtkVideo
GtkVideo implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
#include <gtk/gtk.h>
GtkVideo is a widget to show a GtkMediaStream.
It is commonly combined with GtkMediaControls to give the user a way to control the playback.
GtkWidget *
gtk_video_new (void); Creates a new empty GtkVideo.
a new GtkVideo
GtkWidget *
gtk_video_new_for_media_stream (GtkMediaStream *stream); Creates a GtkVideo to play back the given stream .
stream | [allow-none] |
a new GtkVideo
GtkWidget *
gtk_video_new_for_file (GFile *file); Creates a GtkVideo to play back the given file .
file | a GFile. | [allow-none] |
a new GtkVideo
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.
filename | filename to play back. | [allow-none][type filename] |
a new GtkVideo
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(),
resource_path | resource path to play back. | [allow-none] |
a new GtkVideo
GtkMediaStream *
gtk_video_get_media_stream (GtkVideo *self); Gets the media stream managed by self or NULL if none.
self | a GtkVideo |
The media stream managed by self .
[nullable][transfer none]
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.
self | a GtkVideo | |
stream | The media stream to play or | [allow-none] |
GFile *
gtk_video_get_file (GtkVideo *self); Gets the file played by self or NULL if not playing back a file.
self | a GtkVideo |
The file played by self .
[nullable][transfer none]
void gtk_video_set_file (GtkVideo *self,GFile *file);
Makes self play the given file .
self | a GtkVideo | |
file | the file to play. | [allow-none] |
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(),
self | a GtkVideo | |
filename | the filename to play. | [allow-none] |
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(),
self | a GtkVideo | |
resource_path | the resource to set. | [allow-none] |
gboolean
gtk_video_get_autoplay (GtkVideo *self); Returns TRUE if videos have been set to loop via gtk_video_set_loop().
self | a GtkVideo |
TRUE if streams should 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.
self | a GtkVideo | |
autoplay | whether media streams should autoplay |
gboolean
gtk_video_get_loop (GtkVideo *self); Returns TRUE if videos have been set to loop via gtk_video_set_loop().
self | a GtkVideo |
TRUE if streams should loop
typedef struct _GtkVideo GtkVideo;
“autoplay” property“autoplay” gboolean
If the video should automatically begin playing.
Owner: GtkVideo
Flags: Read / Write
Default value: FALSE
“file” property“file” GFile *
The file played by this video if the video is playing a file.
Owner: GtkVideo
Flags: Read / Write
“loop” property“loop” gboolean
If new media files should be set to loop.
Owner: GtkVideo
Flags: Read / Write
Default value: FALSE
“media-stream” property“media-stream” GtkMediaStream *
The media-stream played
Owner: GtkVideo
Flags: Read / Write
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkVideo.html