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

Add timeout option to uri requests #1382

Open
wants to merge 2 commits into
base: minor
Choose a base branch
from

Conversation

ctedgar
Copy link

@ctedgar ctedgar commented Dec 26, 2024

Hi @ryanheise,

This is a pull request to address #1119, it includes the following changes:

  1. just_audio_platform_interface: Updated the implementations of UriAudioSourceMessage to include the optional timeoutMillis parameter.
  2. just_audio:
  • Added timeout parameters to UriAudioSource and StreamAudioSource implementations.
  • Updated AudioPlayer.java to expect the optional timeout parameter and respect it if set.
  • Added a test case under 'load error' to simulate the timeout error and to also validate the plumbing of the new parameter. (i.e. assert that the timeout property is making it down to the platform message)

I realize there may be a need to implement the same functionality for all other platforms. I've just carried out the changes for Android as it's what I could test comfortably.

I added change notes and bumped the versions both just_audio and just_audio_platform_interface though I suppose just_audio_platform_interface would need to be published first followed by just_audio, if these changes are accepted ofcourse.

Note for local testing: Update just_audio_platform_interface/just_audio_web dependency in just_audio pubspec to point to local folder

Regards,
Cris

@ctedgar ctedgar force-pushed the add-timeout-to-uri-requests branch from 6f1b3a9 to 21fcb63 Compare December 26, 2024 21:54
@ctedgar
Copy link
Author

ctedgar commented Dec 26, 2024

Had not accounted LockCachingAudioSource and the URI proxied requests, so added similar timeout overrides LockCaching requests and for proxied requests.

Regards,
Cris

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

Successfully merging this pull request may close these issues.

1 participant