✨ Support pausing after hiding the video.
This commit is contained in:
@@ -38,6 +38,7 @@ pub fn get_menu() -> Menu {
|
||||
pub fn menu_event_handle(event: WindowMenuEvent) {
|
||||
if event.menu_item_id() == "close" {
|
||||
event.window().minimize().expect("can't minimize window");
|
||||
event.window().eval("toggleVideoPlayback(true);").unwrap();
|
||||
}
|
||||
|
||||
if event.menu_item_id() == "goto_url" {
|
||||
|
||||
@@ -56,7 +56,10 @@ pub fn run_app() {
|
||||
.on_window_event(|event| {
|
||||
if let tauri::WindowEvent::CloseRequested { api, .. } = event.event() {
|
||||
#[cfg(target_os = "macos")]
|
||||
event.window().minimize().unwrap();
|
||||
{
|
||||
event.window().minimize().unwrap();
|
||||
event.window().eval("toggleVideoPlayback(true);").unwrap();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
event.window().close().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user