Skip to content

[Bug] Audiobook Streaming Delay (audioBook.lcpl) – Chunks Fully Buffered Before Playback Starts #579

Open
@mohamedAlhadadi

Description

@mohamedAlhadadi

Describe the bug

Hello Readium team,

First of all, thank you for the recent update enabling progressive streaming for LCP-protected audiobooks — it’s a highly valuable addition, and we appreciate the continued effort.

However, while implementing this feature in our iOS app using the swift-toolkit, we encountered a couple of issues that are affecting the user experience:

1. Delayed Playback with Large Audiobooks

We've noticed that even though the content is streamed in chunks (each of 6MB), the audio does not begin playing until all chunks have been fully downloaded into the buffer.
This behavior is particularly noticeable with large audiobooks that have a single-chapter structure, where the full download can take a significant amount of time, causing a delay before playback begins.

We were expecting playback to start after the first chunk or two becomes available, with the remaining chunks being fetched progressively as needed during playback, rather than all at once upfront.
However, it seems that BufferingResource waits for the entire file to be fully buffered before playback begins.


2. Playback State During Buffering

During this initial buffering period, the playback model returns .playing even though the audio hasn’t started yet.
Ideally, we’d expect a .loading or .buffering state so we can show a loading indicator or spinner to inform the user that playback is still being prepared.


❓ Questions:

  • Is this buffering behavior expected in the current implementation?
  • Is there any internal flag or value that we can use to detect when the audio is still buffering, even if model.playback.state == .playing?
  • Are there any recommended practices to improve the responsiveness of playback and the user feedback during this buffering stage?

Please don't hesitate to ask if you need any additional information to help reproduce or better understand the issue — I’d be happy to provide whatever is needed.

Best regards

How to reproduce?

  1. Open the test app with a .lcpl audiobook file that:
  • Is LCP-protected
  • Has a large file size
  • Has a single chapter

Readium version

3.2.0

OS version

17.2

Testing device

iPhone 15 Pro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions