Skip to content

A self-hosted media server and file management system

feat: keybind to toggle playlist / autoplay

aminnausin731d6b180961
diff --git a/README.md b/README.md
index 5e9d5409..83481efa 100755
--- a/README.md
+++ b/README.md
@@ -86,11 +86,12 @@ Both can serve shows, movies, and music but with different approaches.
- `k`: Play/Pause
- `j` / `←`: Rewind 10s
- `l` / `→`: Fast Forward 10s
- - `SHIFT+N`: Next
- - `SHIFT+P`: Previous
+ - `SHIFT+N`: Play Next
+ - `SHIFT+P`: Play Previous
- `m`: Mute
- `f`: Toggle Fullscreen
- `c`: Toggle Lyrics / Captions
+ - `p`: Toggle playlist (autoplay)
- Playback Features:
- Speed Controls
- Player Statistics
@@ -98,6 +99,7 @@ Both can serve shows, movies, and music but with different approaches.
- Heatmap Visualisation (after 5+ seeks)
- Watch Party UI Demo *(coming soon)*
- Auto-Scrolling Lyrics Viewer
+ - Media Session API Integration
#### 🔗 Sharing
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index 91e523c4..0694aab5 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -927,7 +927,25 @@ const debouncedHandlePrevious = debounce(handlePrevious, 50, { leading: true, tr
const debouncedHandlePlayPause = debounce(handlePlayPause, 50, { leading: true, trailing: false });
const handleKeyBinds = (event: KeyboardEvent, override = false) => {
- const keyBinds = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'l', 'N', 'P', 'j', 'k', 'm', 'c', ' ', 'f', 'MediaTrackNext', 'MediaTrackPrevious', 'MediaPlayPause'];
+ const keyBinds = [
+ 'ArrowLeft',
+ 'ArrowRight',
+ 'ArrowUp',
+ 'ArrowDown',
+ 'l',
+ 'N',
+ 'P',
+ 'p',
+ 'j',
+ 'k',
+ 'm',
+ 'c',
+ ' ',
+ 'f',
+ 'MediaTrackNext',
+ 'MediaTrackPrevious',
+ 'MediaPlayPause',
+ ];
if (!keyBinds.includes(event.key)) return;
if (isInputLikeElement(event.target, event.key) && !override) return;
@@ -945,8 +963,15 @@ const handleKeyBinds = (event: KeyboardEvent, override = false) => {
if (!event.shiftKey) return;
handleNext();
break;
+ case 'p':
case 'P':
- if (!event.shiftKey) return;
+ if (!event.shiftKey) {
+ isPlaylist.value = !isPlaylist.value; // Toggle playlist with P
+ const mediaType = stateFolder.value.is_majority_audio ? 'track' : 'video';
+ const description = isPlaylist.value ? `Will auto play the next ${mediaType}.` : `Will not auto play ${mediaType}s.`;
+ toast(`Playlist ${isPlaylist.value ? 'Enabled' : 'Disabled'}`, { description });
+ break;
+ }
handlePrevious();
break;
case 'm':