Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core and WebRTC for peer-to-peer video chat

What I want to achieve is a POC where two user are chatting in peer-to-peer videocall using ASP.NET Core and WebRTC (if it is necessary SignalR).

Mock screen

I read a lot of documentation about WebRTC and most of the example I found don't work because they show the old implementation of this protocol (for example this tutorial). Also, I saw this implementation on Github but it is using getUserMedia. I got the same error if I use the latest version of adapter.js.

error message

I googled a bit and I found other examples like one article on html5rocks: in this case the indx.html is working locally but if I deploy it on a server I get this error.

enter image description here

The last script I tried to use is Simple Peer.

The new and right way is, if I understood correctly, to use RTCPeerConnection and RTCDataChannel. I can't find a working example.

like image 424
Enrico Rossini Avatar asked Apr 05 '20 23:04

Enrico Rossini


2 Answers

The getusermedia is only available on websites secured with the https protocol or when running in localhost. If it is http the getusermedia is not available.

Working examples are indeed hard to find. I have this github repository which uses simple-peer, has a signaling server and can connect 2+ users together with video chat. You can also try the DEMO of the repository.

like image 97
Dirk V Avatar answered Oct 05 '22 23:10

Dirk V


A good example that work on. Net core 3.1 and javascript: https://github.com/Shhzdmrz/SignalRCoreWebRTC

Working example with signalr core, ionic and peerjs: https://dev.to/timsar2/ionic-video-call-by-peerjs-4fli

Working example with signalr core and angular: https://dev.to/sebalr/video-call-with-webrtc-angular-and-asp-net-core-39hg

like image 38
Mohammad Reza Mrg Avatar answered Oct 06 '22 00:10

Mohammad Reza Mrg