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

AbortError: The play() request was interrupted by a new load request. #1107

Open
andreysamode opened this issue Oct 26, 2023 · 4 comments
Open
Assignees
Labels
1 backlog bug Something isn't working

Comments

@andreysamode
Copy link

andreysamode commented Oct 26, 2023

Which API doesn't behave as documented, and how does it misbehave?
In Chrome on the web version, when switching to a new song while the first song is still loading, I get the following error that interrupts the debug process:
AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22

Minimal reproduction project
https://github.com/mrandrey/just_audio_bug_report/

To Reproduce (i.e. user steps, not code)

  1. Launch in debug mode in Chrome
  2. Quickly click on Song 1, Song 2, Song 3, Song 2, Song 1, etc.
  3. The debug process should interrupt with the error.

Error messages

AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22

Expected behavior
I expect the loading/buffering to stop, then the new song to load.

Desktop (please complete the following information):

  • OS: Mac OS Sonoma
  • Browser: Chrome

Smartphone (please complete the following information):

  • The problem is only on the web version.

Flutter SDK version

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Additional context
The project is to have an album with preview songs and an ability to go to the "full view" on another screen to listen to the entire song if the user has purchased it. If the user clicks on preview, then quickly clicks on the full song button, then they'll get an error because the preview is still buffering while the full song on the next screen is already loading the next song. I need to stop the buffering/loading and load the next song. Ideally, I'd like to load only what the user clicks on, so I'd rather not use a playlist as the solution.

Thanks for looking into this!

@andreysamode andreysamode added 1 backlog bug Something isn't working labels Oct 26, 2023
@CooolWolf
Copy link

I had this problem too

@CooolWolf
Copy link

I think the js implementation should be modified

`

<script> button.addEventListener('click', onButtonClick); function onButtonClick() { // This will allow us to play video later... video.load(); fetchVideoAndPlay(); } function fetchVideoAndPlay() { fetch('https://example.com/file.mp4') .then(response => response.blob()) .then(blob => { video.srcObject = blob; return video.play(); }) .then(_ => { // Video playback started ;) }) .catch(e => { // Video playback failed ;( }) } </script>`

@linchen2chris
Copy link

same here

@max-anders
Copy link

max-anders commented Dec 21, 2024

same, in fact, the behavior of the play() future is strange to me, I remember I had another problem with the fact that it didn't complete, because it seems to me that a solution to this problem would be to simply wait for the future, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants