diff --git a/src/Views/MediaViewer.vala b/src/Views/MediaViewer.vala index b5f7944bf..b448edc06 100644 --- a/src/Views/MediaViewer.vala +++ b/src/Views/MediaViewer.vala @@ -3,6 +3,7 @@ public class Tuba.Views.MediaViewer : Gtk.Box { const double MAX_ZOOM = 20; private signal void zoom_changed (); + static double last_used_volume = 1.0; public class Item : Adw.Bin { private Gtk.Stack stack; @@ -145,6 +146,7 @@ public class Tuba.Views.MediaViewer : Gtk.Box { message ("Destroying MediaViewer.Item"); if (is_video) { + last_used_volume = ((Gtk.Video) child_widget).media_stream.muted ? 0.0 : ((Gtk.Video) child_widget).media_stream.volume; ((Gtk.Video) child_widget).media_stream.stream_unprepared (); ((Gtk.Video) child_widget).set_file (null); ((Gtk.Video) child_widget).set_media_stream (null); @@ -158,6 +160,10 @@ public class Tuba.Views.MediaViewer : Gtk.Box { public void done () { spinner.spinning = false; stack.visible_child_name = "child"; + if (is_video) { + ((Gtk.Video) child_widget).media_stream.volume = 1.0 - last_used_volume; + ((Gtk.Video) child_widget).media_stream.volume = last_used_volume; + }; } private Gtk.Widget setup_scrolledwindow (Gtk.Widget child) {