Getting Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.

3,529 views
Skip to first unread message

Federico Freiberger

unread,
Dec 10, 2018, 8:10:43 AM12/10/18
to EasyRTC

Hey, my app is failing due to this error that started to appear today. I'm using the last Chrome version. Its related to the deprecation of the method that Chrome is warning like a couple of months ago??


2018-12-10 10_06_55-Clipboard.png


Thanks! Any help is appreciated since I'm deploying this web application this week!

Andriy Buchynskyy

unread,
Dec 10, 2018, 9:10:40 AM12/10/18
to EasyRTC
Hello, if I would you I would try to avoid createObjectURL.
And try something like that:
var  track  =  event.streams[0]

video
.srcObject  =  track;

Federico Freiberger

unread,
Dec 10, 2018, 10:48:13 AM12/10/18
to EasyRTC
Yeah, probably something like that would work, but this is the easyrtc.js client that I would need to update. Is there a solution for that already? Or should I go and modify it by myself and wait for a later solution?

Federico Freiberger

unread,
Dec 10, 2018, 11:07:46 AM12/10/18
to EasyRTC
Changed:

this.createObjectURL = function (mediaStream) {

        var errMessage;
        if (window.URL && window.URL.createObjectURL) {
            return window.URL.createObjectURL(mediaStream);
        }
        else if (window.webkitURL && window.webkitURL.createObjectURL) {
            return window.webkit.createObjectURL(mediaStream);
        }
        else {
            errMessage = "Your browsers does not support URL.createObjectURL.";
            logDebug("saw exception " + errMessage);
            throw errMessage;
        }
    };


To 

this.createObjectURL = function (mediaStream) {

        return mediaStream;

        /*var errMessage;
        if (window.URL && window.URL.createObjectURL) {
            return window.URL.createObjectURL(mediaStream);
        }
        else if (window.webkitURL && window.webkitURL.createObjectURL) {
            return window.webkit.createObjectURL(mediaStream);
        }
        else {
            errMessage = "Your browsers does not support URL.createObjectURL.";
            logDebug("saw exception " + errMessage);
            throw errMessage;
        }*/
    };


And It works, throws 

Uncaught (in promise) DOMException


But loads the media correctly, I think I can work with that until a fix wherever it comes.

Federico Freiberger

unread,
Dec 11, 2018, 1:16:20 PM12/11/18
to EasyRTC
Thanks to Devashish Chauhan who answered me on the mail, I'm posting this just for reference.
From his answer:

The correct way is to -

Change   
element.src = self.createObjectURL(stream);

To
element.srcObject = stream;


You will have to do this in the easyrtc.js file. wherever you see -  element.src = self.createObjectURL(stream); just replace it with element.srcObject = stream;

Dimitris Tzimikas

unread,
Jan 7, 2019, 6:57:42 AM1/7/19
to EasyRTC
But if for example device A has android system webview i.e. 59.0... and the device B has 71.0... there is still a problem, at least with my case. The video from device A does not stream to device B. 
Reply all
Reply to author
Forward
0 new messages