Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

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

Open
MobeenAshraf opened this issue Jul 1, 2020 · 6 comments

Comments

@MobeenAshraf
Copy link

Getting following error:

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

It leads to getting audio but doesn't create a video player. The error itself is quite intermittent but has occurred quite a few times now.

From the link: https://goo.gl/LdLk22, mentioned with error, I can see that play method can be a promise and we can do something like:

 var playPromise = video.play();

  if (playPromise !== undefined) {
    playPromise.then(_ => {
      // Automatic playback started!
      // Show playing UI.
    })
    .catch(error => {
      // Auto-play was prevented
      // Show paused UI.
    });
  }
@disoul
Copy link
Collaborator

disoul commented Jul 2, 2020

This AbortError is caused by calling Track.stop() immediately after calling Track.play(), not caused by the autoplay policy. In Agora Web SDK NG, videoTrack.play() will not use Promise to call HTMLVideoElement.play, because there is no autoplay problem in videoTrack.play, SDK's <video> tag does not have any audio source and this <video> tag's muted attribute is true.

If you want to catch the autoplay error in SDK, you should use this callback onAudioAutoplayFailed.

@MobeenAshraf
Copy link
Author

I am not calling stop for remote players. I am calling stop for local track when I am muting/stopping video only

@disoul
Copy link
Collaborator

disoul commented Jul 3, 2020

Ok, You can ignore this warning now. We will hide this warning in the future.

@MobeenAshraf
Copy link
Author

This may be unrelated (and I am not yet able to confirm for now) but whenever this error appears the video container also doesn't appear. I may be able to confirm this if required

@vvedharaju
Copy link

are you using react? could this also be from multiple re-renders triggering play on the same video if there are back to re-renders?

@MobeenAshraf
Copy link
Author

I am using react but it shouldn't be from multiple re-renders.

play is called on user-published and I also un-subscribe on componentWillUnMount.

I will try to post some more details/logs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants