diff --git a/Cargo.lock b/Cargo.lock index 003c492..648189a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2602,6 +2602,7 @@ dependencies = [ "futures-util", "gettext-rs", "gsettings-macro", + "gstreamer", "gtk4", "gvdb-macros", "html2pango", diff --git a/Cargo.toml b/Cargo.toml index 20e41d0..513f249 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ eyre = "0.6.12" futures-util = "0.3.31" gettext-rs = { version = "0.7", features = ["gettext-system"] } gsettings-macro = "0.2.1" +gst = { version = "0.23.2", package = "gstreamer", features = ["v1_24"] } gtk = { version = "0.9.2", package = "gtk4", features = ["gnome_46", "blueprint"] } gvdb-macros = "0.1.13" html2pango = "0.6.0" diff --git a/src/player.rs b/src/player.rs index f000231..4bb5dfe 100644 --- a/src/player.rs +++ b/src/player.rs @@ -55,6 +55,21 @@ mod imp { )); let slf = self.obj(); + + let taginject = gst::ElementFactory::make("taginject") + .property("scope", gst::TagScope::Global) + .build() + .expect("failed to create `taginject` element"); + self.video + .player() + .expect("should not be nullable") + .set_video_filter(Some(&taginject)); + slf.connect_title_notify(glib::clone!( + #[weak] + taginject, + move |slf| taginject.set_property("tags", format!("title={}", slf.title())) + )); + self.video.connect_toggle_fullscreen(glib::clone!( #[weak] slf,