[PR #4721] Update LocalAudioPlayer and chapters view for improved functionality #4326

Open
opened 2026-04-25 00:19:17 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4721
Author: @solar141
Created: 10/5/2025
Status: 🔄 Open

Base: masterHead: pr-two-files


📝 Commits (1)

  • 98a01b8 Update LocalAudioPlayer and chapters view for improved functionality

📊 Changes

2 files changed (+15 additions, -9 deletions)

View changed files

📝 client/pages/audiobook/_id/chapters.vue (+10 -9)
📝 client/players/LocalAudioPlayer.js (+5 -0)

📄 Description

Brief summary

This PR fixes two issues related to audio playback in the Audiobookshelf client: preventing multiple audio streams from playing simultaneously and ensuring chapter previews stop at the end of the chapter without auto-advancing.

Which issue is fixed?

Chapter Preview Doesn’t Stop at Chapter End
Multiple Audio Streams Playing Simultaneously

In-depth Description

Multiple Audio Streams Playing Simultaneously:

The issue occurs when multiple audio streams (e.g., from different chapters or previews) start playing at the same time, leading to overlapping sounds.
Solution: Added event listeners to detect when a new audio stream begins and automatically pause any currently playing audio. This ensures only one stream is active at a time.
Updated files: client/pages/audiobook/_id/chapters.vue and client/players/LocalAudioPlayer.js.
This is a common edge case for users previewing multiple chapters quickly, improving the overall user experience by preventing audio chaos without affecting core playback logic.

Chapter Preview Doesn’t Stop at Chapter End:

The problem is that when previewing a single chapter, the player auto-advances to the next chapter instead of stopping at the end.
Solution: Removed the auto-advance logic specifically for single-chapter preview mode, allowing the playback to end naturally at the chapter's conclusion.
Updated file: client/pages/audiobook/_id/chapters.vue.
This fix targets preview functionality, which is useful for users scanning books, and doesn't impact full audiobook playback.

How have you tested this?

Open an audiobook page in a local development environment (run npm run dev).
Start playing a chapter preview.
Quickly start another chapter preview.
Verify that the first audio pauses immediately when the second starts, with no overlap.
Test with multiple browsers/tabs to simulate concurrent plays.
Ensured no regression in standard full-book playback.

Screenshots


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4721 **Author:** [@solar141](https://github.com/solar141) **Created:** 10/5/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `pr-two-files` --- ### 📝 Commits (1) - [`98a01b8`](https://github.com/advplyr/audiobookshelf/commit/98a01b8b10857dd20ba2476469f0bd8e8cfeb456) Update LocalAudioPlayer and chapters view for improved functionality ### 📊 Changes **2 files changed** (+15 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `client/pages/audiobook/_id/chapters.vue` (+10 -9) 📝 `client/players/LocalAudioPlayer.js` (+5 -0) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary This PR fixes two issues related to audio playback in the Audiobookshelf client: preventing multiple audio streams from playing simultaneously and ensuring chapter previews stop at the end of the chapter without auto-advancing. ## Which issue is fixed? Chapter Preview Doesn’t Stop at Chapter End Multiple Audio Streams Playing Simultaneously ## In-depth Description Multiple Audio Streams Playing Simultaneously: The issue occurs when multiple audio streams (e.g., from different chapters or previews) start playing at the same time, leading to overlapping sounds. Solution: Added event listeners to detect when a new audio stream begins and automatically pause any currently playing audio. This ensures only one stream is active at a time. Updated files: client/pages/audiobook/_id/chapters.vue and client/players/LocalAudioPlayer.js. This is a common edge case for users previewing multiple chapters quickly, improving the overall user experience by preventing audio chaos without affecting core playback logic. Chapter Preview Doesn’t Stop at Chapter End: The problem is that when previewing a single chapter, the player auto-advances to the next chapter instead of stopping at the end. Solution: Removed the auto-advance logic specifically for single-chapter preview mode, allowing the playback to end naturally at the chapter's conclusion. Updated file: client/pages/audiobook/_id/chapters.vue. This fix targets preview functionality, which is useful for users scanning books, and doesn't impact full audiobook playback. ## How have you tested this? Open an audiobook page in a local development environment (run npm run dev). Start playing a chapter preview. Quickly start another chapter preview. Verify that the first audio pauses immediately when the second starts, with no overlap. Test with multiple browsers/tabs to simulate concurrent plays. Ensured no regression in standard full-book playback. ## Screenshots <!-- If your PR includes any changes to the web client, please include screenshots or a short video from before and after your changes. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:17 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4326