Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hotkeys to the audio player #1203

Merged
merged 12 commits into from
Dec 11, 2023
Merged

Conversation

RatulMaharaj
Copy link
Contributor

@RatulMaharaj RatulMaharaj commented Oct 20, 2023

This PR Implements hotkeys to control the audio player via the keyboard.

Hotkey Description
i Toggle player visibility (currently only if a show is loaded)
m Toggle the player mute state
Space Pause / Play audio
j Seek backward 30s
l Seek forward 30s
< Increase playback rate
> Decrease playback rate
? Show hotkey help

Note
The above is largely influenced by Youtube's player shortcuts. I also considered the Spotify shortcuts.

I don't have strong opinions about what the actual keys used should be, so if anyone else does, happy for it to be changed.

Related to #1195

Updates

  1. Stopping audio and removing show on player close.

  2. Implemented a MINIMIZED version of the player

image

  1. Added ? hotkey to the above

  2. Added a global hotkey ? / shift+/ to bring up the list of hotkeys.

image

@vercel
Copy link

vercel bot commented Oct 20, 2023

@RatulMaharaj is attempting to deploy a commit to the Syntax Team on Vercel.

A member of the Team first needs to authorize it.

@wesbos wesbos changed the base branch from v2 to main October 20, 2023 19:32
@RatulMaharaj RatulMaharaj marked this pull request as draft October 20, 2023 21:38
@RatulMaharaj RatulMaharaj force-pushed the player-hotkeys branch 2 times, most recently from f08a141 to 7e98703 Compare October 26, 2023 00:54
@RatulMaharaj RatulMaharaj marked this pull request as ready for review October 26, 2023 01:09
@RatulMaharaj
Copy link
Contributor Author

@wesbos this should be ready for review now.

@wesbos
Copy link
Collaborator

wesbos commented Oct 30, 2023

thanks a ton - will review shortly

@themisterholliday
Copy link
Contributor

This should also fix: #1338

@stolinski
Copy link
Collaborator

Love the menu here. @wesbos would you mind if I were to merge this into my embed branch instead of main and merge with the work i'm doing?
Reason being is I've made a number of changes to the player itself so merging into main might put us in a conflict

@stolinski
Copy link
Collaborator

Hey @RatulMaharaj this is awesome however since it conflicts with some design changes I've made in a branch, I'm going to merge it there instead of main and massage the merge a bit.

Thank you, this is great!

@stolinski stolinski changed the base branch from main to embe December 11, 2023 17:27
@stolinski stolinski merged commit a42dc1b into syntaxfm:embe Dec 11, 2023
0 of 3 checks passed
stolinski added a commit that referenced this pull request Dec 15, 2023
* adds header icons

* Add hotkeys to the audio player (#1203)

* Add @svelte-put/shortcut as a dependency

* Implement player hotkeys

* Pause and reset show on player close

* Implement minimized player

* Move hotkeys into +layout and refactor into object

* Remove unused test file

* Implement hotkey modal

* Add vitest tests for formatShortcut util

* Rebuild lockfile after rebase

* Update modal styling

* Reset core-js version

---------

Co-authored-by: Scott Tolinski <[email protected]>

* moves status into it's own writable

* Stop the player and reset player state when close is called (#1425)

Co-authored-by: Scott Tolinski <[email protected]>

* adds more complex player status to player state for more control

* reworks hotkeys to fix play pause issues

* major work on hotkeys and adds share window

* modifies redirects hook to keep query params on redirect

* adds completes timestamp at time links

* slight tweak to hotkeys

* ficxes icon issue caused by merge

---------

Co-authored-by: Ratul Maharaj <[email protected]>
Co-authored-by: Craig Holliday <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants