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

Use LoadErrorHandlingPolicy for Downloads/Offline media segment requests #2064

Open
mayurk2 opened this issue Jan 21, 2025 · 1 comment
Open
Assignees

Comments

@mayurk2
Copy link
Contributor

mayurk2 commented Jan 21, 2025

I am using Exoplayer 2.16.1 in my application. I am trying to control number of segment calls during download for offline playback.

I am trying to control the number of segment API calls in case of HTTP error using custom LoadErrorHandlingPolicy.

This is the high level flow.

val errorHandlingPolicy = CustomDownloadErrorHandlingPolicy(maxRetryCount)

val factory = DashMediaSource.Factory(dataSourceFactory)

val mediaSource = factory
            .setLoadErrorHandlingPolicy(errorHandlingPolicy)
            .createMediaSource(mediaItem)

val downloadHelper = DownloadHelper(
                    mediaItem,
                    mediaSource,
                    DefaultTrackSelector.Parameters.DEFAULT_WITHOUT_CONTEXT,
                    DownloadHelper.getRendererCapabilities(DefaultRenderersFactory(context))

downloadHelper.prepare(this@DownloadPrepareHelper)

I observed that if there is some HTTP error for manifest request, the overridden method of my CustomDownloadErrorHandlingPolicy object is called. (getMinimumLoadableRetryCount(), getRetryDelayMsFor() etc.)

But if there is some error for Segment requests, the callbacks are not getting called. The Exoplayer is trying ~4 times and then throwing error.

With this I am not able to set the right retry count.

Is there a way to set the LoadErrorHandlingPolicy for segments? Or is it a bug in Exoplayer?

@tonihei
Copy link
Collaborator

tonihei commented Jan 24, 2025

LoadErrorHandlingPolicy is currently unused in the download infrastructure, I'll mark it as a feature request.

@tonihei tonihei self-assigned this Jan 24, 2025
@tonihei tonihei changed the title Why LoadErrorHandlingPolicy is not applied for Downloads/Offline media segment requests? Use LoadErrorHandlingPolicy for Downloads/Offline media segment requests Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants