From 7046622fb6ba4b51c441ee2ea4fbd90fa4d2ba7f Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Wed, 17 Dec 2025 14:15:06 +0200 Subject: [PATCH] feat: player - mute shortcut Signed-off-by: Lachezar Lechev --- src/common/Shortcuts/shortcuts.json | 5 +++++ src/routes/Player/Player.js | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/common/Shortcuts/shortcuts.json b/src/common/Shortcuts/shortcuts.json index 766288fb0..f66d13abb 100644 --- a/src/common/Shortcuts/shortcuts.json +++ b/src/common/Shortcuts/shortcuts.json @@ -59,6 +59,11 @@ "label": "SETTINGS_SHORTCUT_VOLUME_DOWN", "combos": [["ArrowDown"]] }, + { + "name": "mute", + "label": "SETTINGS_SHORTCUT_MUTE", + "combos": [["M"]] + }, { "name": "subtitlesSize", "label": "SETTINGS_SHORTCUT_SUBTITLES_SIZE", diff --git a/src/routes/Player/Player.js b/src/routes/Player/Player.js index 27f705be8..1b2c50cca 100644 --- a/src/routes/Player/Player.js +++ b/src/routes/Player/Player.js @@ -568,7 +568,7 @@ const Player = ({ urlParams, queryParams }) => { const videoId = player.selected ? player.selected?.streamRequest?.path?.id : null; const video = metaItem ? metaItem.videos.find(({ id }) => id === videoId) : null; - const videoInfo = video && video.season && video.episode ? ` (${video.season}x${video.episode})`: null; + const videoInfo = video && video.season && video.episode ? ` (${video.season}x${video.episode})` : null; const videoTitle = video ? `${video.title}${videoInfo}` : null; const metaTitle = metaItem ? metaItem.name : null; const imageUrl = metaItem ? metaItem.logo : null; @@ -693,6 +693,10 @@ const Player = ({ urlParams, queryParams }) => { onIncreaseSubtitlesDelay(); break; } + case 'KeyM': { + (typeof video.state.muted === 'boolean' && video.state.muted) ? onUnmuteRequested() : onMuteRequested(); + break; + } case 'Minus': { onUpdateSubtitlesSize(-1); break; @@ -747,6 +751,7 @@ const Player = ({ urlParams, queryParams }) => { video.state.paused, video.state.time, video.state.volume, + video.state.muted, video.state.audioTracks, video.state.subtitlesTracks, video.state.extraSubtitlesTracks, @@ -754,6 +759,9 @@ const Player = ({ urlParams, queryParams }) => { toggleSubtitlesMenu, toggleStatisticsMenu, toggleSideDrawer, + onUnmuteRequested, + onMuteRequested, + overlayHidden, onDecreaseSubtitlesDelay, onIncreaseSubtitlesDelay, onUpdateSubtitlesSize,