com.unity.webrtc | WebRTC package for Unity | Game Engine library
kandi X-RAY | com.unity.webrtc Summary
kandi X-RAY | com.unity.webrtc Summary
WebRTC package for Unity
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of com.unity.webrtc
com.unity.webrtc Key Features
com.unity.webrtc Examples and Code Snippets
Community Discussions
Trending Discussions on com.unity.webrtc
QUESTION
Although WebRTC is meant for conference calls, it's possible to capture a MediaStream
and use that as a source for an RTCPeerConnection
. As it happens, this could be a solution to a problem I'm facing: displaying a live-stream in a WebGL app that doesn't support them.
(The idea is to use a library like HLS.js to handle assembling and remuxing the live-stream, and then stream that video into my WebGL app. The app's built in Unity, the game engine, which has introduced a package for WebRTC, so I'd be able to display that.)
According to the docs, a server is required to act as a middleman between clients. From what I understood, however, this is essentially to help them find each other and agree to connect over a P2P network. Since the two apps—the WebGL app and a Node app/JS script—live on the same client, even the same browser window, maybe I could omit the middelman and connect directly?
Unfortunately, I haven't been able to find anything regarding this method—probably because it's such an unusual use-case. Is it possible? If so, is it feasible, and how might it be done?
...ANSWER
Answered 2021-Jul-02 at 00:59If I understood your question correctly, you want to achieve WebRTC connection without having an actual signaling server.
WebRTC itself does not care how you provide it with Offer, Answer and Ice Candidates, but I don't see a "normal" way of exchanging this information without using a signaling server.
QUESTION
So Unity seems to have wrapped WebRTC in a neat package. This looks like good news, since they deprecated UNET without placing a counterbalance first. Whatever.
I now just so happen to have to implement multiplayer for some games, and since my company doesn't want to invest without having a first impression of how it will be received by gamers, I have to make do without a server to handle connections. So I stumbled on WebRTC, of which DataChannels seem to be perfect for my use case, since I will have to transmit a few bytes representing the game state (which is in lockstep, so no problem there).
However, for the life of me I can't understand how this thing works.
It looks like it exchanges addresses and other data via a google STUN server, does some offer\answer shenanigans, and thus the data channel is established. However I can't understand how it knows that 2 devices are the ones that need to be connected, and I can't understand why my code doesn't work. I made a class that connects local and remote peers, so they should be able to exhange data, right?
...ANSWER
Answered 2020-Nov-13 at 10:25Your logic looks largely correct to me. I don't know if it will fix your issue but to make things clearer I would adjust your SDP exchange so the description objects aren't overwritten.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install com.unity.webrtc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page