From 94ecf4a069cd4ebf3538feb4cd8083850f6ea3df Mon Sep 17 00:00:00 2001 From: stax76 Date: Thu, 5 Sep 2024 23:33:13 +0200 Subject: [PATCH] try fixing #662 --- docs/manual.md | 4 ++-- src/MpvNet.Windows/WinForms/MainForm.cs | 7 ++++--- src/MpvNet/InputHelp.cs | 2 +- src/MpvNet/Player.cs | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/manual.md b/docs/manual.md index b518643..797cb41 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -1093,11 +1093,11 @@ Cycles the deinterlace property using the following command: Cycles the aspect ratio using the following command: -`cycle-values video-aspect 16:9 4:3 2.35:1 -1` +`cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1` [cycle-values command](https://mpv.io/manual/master/#command-interface-cycle-values) -[video-aspect property](https://mpv.io/manual/master/#command-interface-video-aspect) +[video-aspect property](https://mpv.io/manual/master/#options-video-aspect-override) ### Audio > Next diff --git a/src/MpvNet.Windows/WinForms/MainForm.cs b/src/MpvNet.Windows/WinForms/MainForm.cs index 4ae34d3..86ac38f 100644 --- a/src/MpvNet.Windows/WinForms/MainForm.cs +++ b/src/MpvNet.Windows/WinForms/MainForm.cs @@ -1046,11 +1046,12 @@ public partial class MainForm : Form break; case 0x319: // WM_APPCOMMAND { - string? value = MpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000)); + string? key = MpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000)); + bool inputMediaKeys = Player.GetPropertyBool("input-media-keys"); - if (value != null) + if (key != null && inputMediaKeys) { - Player.Command("keypress " + value); + Player.Command("keypress " + key); m.Result = new IntPtr(1); return; } diff --git a/src/MpvNet/InputHelp.cs b/src/MpvNet/InputHelp.cs index 3d68ab8..4c75a9b 100644 --- a/src/MpvNet/InputHelp.cs +++ b/src/MpvNet/InputHelp.cs @@ -79,7 +79,7 @@ public static class InputHelp new (_("Video"), _("Take Screenshot"), "async screenshot", "s"), new (_("Video"), _("Take Screenshot without subtitles"), "async screenshot video", "S"), new (_("Video"), _("Toggle Deinterlace"), "cycle deinterlace", "d"), - new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 -1", "a"), + new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1", "a"), new (_("Video"), _("Rotate Video"), "cycle-values video-rotate 90 180 270 0", "Ctrl+r"), new (_("Audio"), _("Audio Device")), diff --git a/src/MpvNet/Player.cs b/src/MpvNet/Player.cs index c9ccbce..e97b8b3 100644 --- a/src/MpvNet/Player.cs +++ b/src/MpvNet/Player.cs @@ -102,6 +102,7 @@ public class MainPlayer : MpvClient SetPropertyBool("input-default-bindings", true); SetPropertyBool("input-builtin-bindings", false); + SetPropertyBool("input-media-keys", true); SetPropertyString("media-controls", "yes"); SetPropertyString("idle", "yes");