简体   繁体   中英

Video Player error Uncaught in promise DOMException

I have Video Player . But when I change the quality its giving this error

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

JavaScript

e(".ad-quality-option").on("click", function() {
    w.pause()
    var t = e(this).html();
    e(".ad-quality-dropdown").fadeOut(fade), 
        e(".ad-quality-menu").html(t);
    var a = e(this).attr("data-quality");
    w.src = a,
        w.addEventListener("canplay",  function() {    
        w.currentTime=e(".ad-video").attr("data-current"),w.play() });
})

This could be a race condition between 2 promises. same issue here .

If you use video player by default and don't have "src" attribute, this issue occurs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM