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

readDataFull returns max 10MB of data #150

Open
ronghester opened this issue Apr 4, 2019 · 1 comment
Open

readDataFull returns max 10MB of data #150

ronghester opened this issue Apr 4, 2019 · 1 comment

Comments

@ronghester
Copy link

This issue is a Bug|Question

Package:
org.readium.sdk.android
Class:
PackageResource
Method:
readDataFull()
Issue: When dealing with resource more than 17MB of size then readDataFull() method is returning maximum 10mb of data. What should be changed in order to get all the data from resource?

If getInputStream(true) method is used then the full track data is returned. However this requires to get the input stream and then change it to bytes[] this process takes time and impacting the performance of the player.

Is there any work around so that readDataFull() return full data.

Thanks

@danielweck
Copy link
Member

My comments extracted from the parallel Slack discussion:

You should absolutely avoid loading large audio/video buffers in memory. Instead, stream chunks of data via the HTTP transport layer (HTTP 1.1 partial requests / byte ranges is fine for that). That's how the ReadiumSDK is designed, and it even works with encrypted resources.

Typically, in SDKLauncher apps EPUB resources are served over HTTP, so an audio asset from a (zipped) publication would typically be accessible through a URL like http://120.0.0.1:9090/pub/ID/path/to/audio.mp3 => the HTTP server is 1.1 compliant so it will respond correctly to partial byte range request, i.e. it will emit buffer chunks on demand (and the ReadiumSDK resource stream architecture takes care of fetching small amounts of data from the zipped publication)

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

No branches or pull requests

2 participants