tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

[Feature] Add keyboard shortcuts for controlling media playback

Open egoarka opened this issue 1 year ago • 5 comments

Is your feature request related to a problem?

Add ability to control media playback with shortcuts.

Describe the solution you'd like

Mod + n - next track Mod + p - prev track Mod + c - pause Mod + s - reverse order / shuffle Mod + r - repeat Mod + -/+ - control volume Mod + </> - control playback speed Mod + Shift + Left Arrow key - rewind by 10 seconds Mod + Shift + Right Arrow key - fast forward by 10 seconds Mod + x - close media

Where Mod might be Ctrl or Alt key

Describe alternatives you've considered

automate by clicking on media controls by locating them on screen with automating tools

Additional context

No response

egoarka avatar Oct 26 '24 19:10 egoarka

First three shortcuts already exist but with different keys

ilya-fedin avatar Oct 26 '24 19:10 ilya-fedin

Thanks. could not find info about it anywhere, found myself by randomly typing fn keys, so in case someone is looking for them: F5 - prev track F6 - pause F7 - next track


In case someone wants to remap them easily with xremap on linux, here is a config.

keymap:
  - name: Telegram binding
    application:
      only: [TelegramDesktop]
    remap:
      C-p: KEY_PREVIOUSSONG
      C-n: KEY_NEXTSONG
      C-c: KEY_PLAYPAUSE

egoarka avatar Oct 26 '24 19:10 egoarka

They are mapped to media keys by default in fact and they could be on a completely different key on a different keyboard.

    {
        "command": "media_play",
        "keys": "media play"
    },
    {
        "command": "media_stop",
        "keys": "media stop"
    },
    {
        "command": "media_previous",
        "keys": "media previous"
    },
    {
        "command": "media_next",
        "keys": "media next"
    },
    {
        "command": "media_pause",
        "keys": "media pause"
    },
    {
        "command": "media_playpause",
        "keys": "toggle media play/pause"
    },

ilya-fedin avatar Oct 26 '24 19:10 ilya-fedin

I don't need complex control of media, and wouldn't use all of those shortcuts, but I really would use a simple jump forward and backward using the arrow keys all the time. Currently they advance/retreat back to other videos on the timeline. That's a nice feature, but if I had to choose I would much prefer the ability to jump around within the current track using the unassisted arrow keys. It's something I'm used to with videos in browsers and in my desktop media player, but is lacking in TG.

paul1149 avatar Jan 16 '25 23:01 paul1149

Implementing YouTube-like video player shortcuts, such as number keys for jumping to specific percentages, controls for adjusting playback speed, slow and fast forward options, and accelerated fast forward, would significantly enhance accessibility.

Keyboard shortcut Function
Spacebar Play/Pause when the seek bar is selected. Activate a button if a button has focus.
Play/Pause Media Key on keyboards Play / Pause.
k Pause/Play in player.
m Mute/unmute the video.
Stop Media Key on keyboards Stop.
Next Track Media Key on keyboards Moves to the next track in a playlist.
Left/Right arrow on the seek bar Seek backward/forward 5 seconds.
j Seek backward 10 seconds in player.
l Seek forward 10 seconds in player.
Ctrl + → (Windows) or ⌥ + → (Mac) Go to the next chapter.
Ctrl + ← (Windows) or ⌥ + ← (Mac) Go back to the previous chapter.
. While the video is paused, skip to the next frame.
, While the video is paused, go back to the previous frame.
Shift + . Speed up the video playback rate.
Shift + , Slow down the video playback rate.
Home/End on the seek bar Seek to the beginning/last seconds of the video.
Up/Down arrow on the seek bar Increase/Decrease volume 5%.
Numbers 1 to 9 Seek to the 10% to 90% of the video.
Number 0 Seek to the beginning of the video.
/ Go to search box.
f Activate full screen. If full screen mode is enabled, activate F again or press escape to exit full screen mode.
c Activate closed captions and subtitles if available. To hide captions and subtitles, activate C again.
Shift+N Move to the next video (If you're using a playlist, will go to the next video of the playlist. If not using a playlist, it will move to the next YouTube suggested video).
Shift+P Move to the previous video. Note that this shortcut only works when you're using a playlist.
i Open the Miniplayer.

https://support.google.com/youtube/answer/7631406?hl=en

a-b avatar Nov 06 '25 21:11 a-b