SIP.js icon indicating copy to clipboard operation
SIP.js copied to clipboard

DOMException: The play() request was interrupted by a new load request. [email protected]

Open edsel77 opened this issue 5 years ago • 2 comments

I am still encountering this error during outbound call using version 0.15.6 DOMException: The play() request was interrupted by a new load request. No audio was being played on both ends

This can be referenced on this issue: https://github.com/onsip/SIP.js/issues/564

Debug error: image

Anyone has the solution?

edsel77 avatar Aug 19 '20 15:08 edsel77

i got this error too

et-hh avatar Dec 10 '20 06:12 et-hh

I solved it a while ago by modifying a little bit the assignStream function (from here) to be the following one:

    // Assign a MediaStream to an HTMLMediaElement and update if tracks change.
    private assignStream(stream: MediaStream, element: HTMLMediaElement): void
    {
        // Set element source.
        element.autoplay = true; // Safari does not allow calling .play() from a non user action
        element.srcObject = stream;

        element.addEventListener("canplay", function (e)
        {
            var playPromise = element.play();
            if (playPromise !== null)
            {
                playPromise.catch((error: Error) =>
                {
                    console.error("Failed to play media");
                    console.error(error);
                });
            }
        });
 
        element.load();
    }

slavikbialik avatar Jan 27 '21 19:01 slavikbialik

Addressed in 0.17.0 or 0.18.0. See docs here

john-e-riordan avatar Sep 29 '22 14:09 john-e-riordan