Ubidots Community

Issues with using webRTC in HTML Canvas

Hi,

I am having issues with creating an instance of RTCPeerConnection in HTML Canvas:

const servers = {
//server details
};
const pc = new RTCPeerConnection(servers);

Following error message is output as a consequence:

Uncaught (in promise) Error: Cannot read properties of null (reading ‘endsWith’)
at wrappedSendMessageCallback

Is there a way to resolve this issue?

Hello, @jin167

Thanks for reaching out,

The RTCPeerConnection interface is supported by the HTML canvas but I suggest you try to establish the connections locally first and then move on to the HTML canvas. Have you tried this code locally and experienced the same problem?

Regards,

-Santiago