[gtk/wip/otte/lottie: 1/77] video: When autoplaying, start playing once the video is prepared




commit 1ee6766f89144eadb8aeccbc5f1935963a06d656
Author: Benjamin Otte <otte redhat com>
Date:   Wed Dec 16 02:22:26 2020 +0100

    video: When autoplaying, start playing once the video is prepared
    
    This fixe video sources with longer loading times not automatically
    playing.

 gtk/gtkvideo.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c
index 9f3eb43d94..d2cb23321a 100644
--- a/gtk/gtkvideo.c
+++ b/gtk/gtkvideo.c
@@ -545,6 +545,11 @@ gtk_video_notify_cb (GtkMediaStream *stream,
     gtk_video_update_error (self);
   if (g_str_equal (pspec->name, "playing"))
     gtk_video_update_playing (self);
+  if (g_str_equal (pspec->name, "prepared"))
+    {
+      if (self->autoplay && gtk_media_stream_is_prepared (stream))
+        gtk_media_stream_play (stream);
+    }
 }
 
 /**


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