[PR #4562] [CLOSED] Fixes hls crash on Android #4287

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4562
Author: @Vito0912
Created: 8/6/2025
Status: Closed

Base: masterHead: fix/hlscrash


📝 Commits (1)

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 server/controllers/SessionController.js (+10 -0)

📄 Description

Brief summary

The new getTrack is made for real files instead of hls streams. Since we use the metadata object, which does not exist on the hls audioTrack object, the server crashes. This PR adds a redirect to the hls source. I have NOT checked if it works with the android app and if it can follow redirects, but this at least stops the server from crashing. The hls stream should be reached using the correct URL anyway (shouldn't it?).

I am not up to date on the mobile repo, but it would need to be changed (in case it does not follow redirects) so it requests hls streams directly

Which issue is fixed?

fixes https://github.com/advplyr/audiobookshelf/issues/4555

In-depth Description

Look at the code xD. Short description should give enough hints.
SessionController.js
PlaybackSessionManager.js
AudioTrack.js

How have you tested this?

local dev server

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/4562 **Author:** [@Vito0912](https://github.com/Vito0912) **Created:** 8/6/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/hlscrash` --- ### 📝 Commits (1) - [`b47fe9e`](https://github.com/advplyr/audiobookshelf/commit/b47fe9e2d8c9e6568edf6cba1c9f91e48ea65ea4) fixes hls crash ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/SessionController.js` (+10 -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 The new getTrack is made for real files instead of hls streams. Since we use the metadata object, which does not exist on the hls audioTrack object, the server crashes. This PR adds a redirect to the hls source. I have NOT checked if it works with the android app and if it can follow redirects, but this at least stops the server from crashing. The hls stream should be reached using the correct URL anyway (shouldn't it?). I am not up to date on the mobile repo, but it would need to be changed (in case it does not follow redirects) so it requests hls streams directly ## Which issue is fixed? fixes https://github.com/advplyr/audiobookshelf/issues/4555 ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it solve a problem that affects multiple users or is this an edge case for your setup? --> Look at the code xD. Short description should give enough hints. SessionController.js PlaybackSessionManager.js AudioTrack.js ## How have you tested this? local dev server ## 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:08 +02:00
adam closed this issue 2026-04-25 00:19:08 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4287