daihiepkhach.vn Answers was designed to lớn reduce the constant googling that comes with debugging 3rd party libraries. It collects liên kết to all the places you might be looking at while hunting down a tough bug.

Bạn đang xem: Uncaught (in promise) domexception: the fetching process for the media resource was aborted by the user agent at the user's request

And, if you’re still stuck at the end, we’re happy to hop on a gọi to see how we can help out.


Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()

See original GitHub issue

When the clip is stopped và I’m dragging the plyr__progress bar to lớn the next minute,it appears this error:

Plyr v1.8.12

*


*
Top GitHub Comments


I use pretty javascript code solve it:

video.src = "xxx";video.load();setTimeout(function() video.play();, 0);
I would lượt thích to reopen this because the aforementioned Chrome issue says the error is fixed for when calling HTMLMediaElement.pause before HTMLMediaElement.play, but calling HTMLMediaElement.play và then HTMLMediaElement.pause while the media is loading still throws the error.

Xem thêm: Top 10 Phần Mềm Dịch Tiếng Hàn Sang Tiếng Việt Chính Xác Và Thông Dụng Nhất Hiện Nay

// fixedmedia.pause();media.play();// won"t fix; still shows the issue.media.play();media.pause();HTMLMediaElement.play is async and returns a promise. The error complains about having called HTMLMediaElement.pause before the playback started.

I would like to quote lớn the Chromium issue owner:

This has been resolved a long time ago. If you are seeing an error but that your website otherwise behave exactly the same, this is not a bug in Chrome but in your website. If you are seeing an error in the console and your website stopped behaving properly, please tệp tin another bug with a thử nghiệm page.

In this case, everything behaves exactly the same và it won’t get fixed by the Chromium team because the điện thoại tư vấn to HTMLMediaElement.play returns a promise that gets resolved when the truyền thông element is ready to play. At that point, the hotline to HTMLMediaElement.pause can be made. Since we rely on Plyr khổng lồ handle HTMLMediaElement, it should either know about the promise returned by HTMLMediaElement.play and smartly điện thoại tư vấn HTMLMediaElement.pause when it’s resolved, or at least provide a way lớn interact with the promise by returning it when calling plyr.play. I tried to look at plyr.isPaused() và plyr.getMedia().paused in order to lớn work around it myself, but they’re false even though they didn’t start playing yet because of buffering. I also tried to use plyr.getMedia().play() instead of plyr.play() in order lớn get the promise & then always gọi pause/stop when the promise resolves, but eventually, I get the error again, so maybe I’m missing something. I think that Plyr could keep a track of this promise internally so that users don’t need to worry about this issue.