Enrico
Enrico

Reputation: 6202

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.

Upvotes: 21

Views: 26740

Answers (2)

Mohammad Reza Mrg
Mohammad Reza Mrg

Reputation: 2033

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

Upvotes: 14

Dirk V
Dirk V

Reputation: 1469

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.

Upvotes: 6

Related Questions