[gtk/matthiasc/gl-media-stream] gtk-demo: Use GtkVideo in the fishbowl




commit fb31581bb4766020bc6beeadf47bcc4b51b45baf
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 4 18:26:29 2021 -0500

    gtk-demo: Use GtkVideo in the fishbowl
    
    The demo is called 'Video', so we should actually
    use a GtkVideo widget. Doing things this way has
    the advantage that we get GL support, which wasn't
    working with GtkPicture.

 demos/gtk-demo/fishbowl.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c
index 659318b7cd..8c39ef6014 100644
--- a/demos/gtk-demo/fishbowl.c
+++ b/demos/gtk-demo/fishbowl.c
@@ -119,13 +119,12 @@ create_label (void)
 static GtkWidget *
 create_video (void)
 {
-  GtkMediaStream *stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
-  GtkWidget *w = gtk_picture_new_for_paintable (GDK_PAINTABLE (stream));
+  GtkWidget *w = gtk_video_new ();
 
   gtk_widget_set_size_request (w, 64, 64);
-  gtk_media_stream_set_loop (stream, TRUE);
-  gtk_media_stream_play (stream);
-  g_object_unref (stream);
+  gtk_video_set_loop (GTK_VIDEO (w), TRUE);
+  gtk_video_set_autoplay (GTK_VIDEO (w), TRUE);
+  gtk_video_set_resource (GTK_VIDEO (w), "/images/gtk-logo.webm");
 
   return w;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]