WebRTC Signalling for Delphi
Peer-to-peer real-time communication for audio, video, and data. Build video conferencing, voice calls, and low-latency data channels directly in your Delphi applications.
Peer-to-peer real-time communication for audio, video, and data. Build video conferencing, voice calls, and low-latency data channels directly in your Delphi applications.
Server-side WebRTC signalling channel. Bind it on top of a TsgcWebSocketHTTPServer, declare the ICE servers it pushes to each joining peer, broadcast SDP and ICE candidates between them.
TsgcWSPServer_WebRTC
WebRTC signalling channel
Windows, macOS, Linux, iOS, Android
Professional / Enterprise
Attach TsgcWSPServer_WebRTC to a TsgcWebSocketHTTPServer, push ICE servers, broadcast SDP / ICE candidates to channel subscribers.
uses
sgcWebSocket, sgcWebSocket_Server, sgcWebSocket_Protocols;
var
WSServer: TsgcWebSocketHTTPServer;
WebRTC: TsgcWSPServer_WebRTC;
begin
WSServer := TsgcWebSocketHTTPServer.Create(nil);
WSServer.Port := 443;
WSServer.SSL := True;
WebRTC := TsgcWSPServer_WebRTC.Create(nil);
WebRTC.Server := WSServer;
// one JSON RTCConfiguration object, pushed to every joining peer
WebRTC.WebRTC.IceServers.Add(
'{"iceServers": [{"urls": "stun:stun.l.google.com:19302"}]}');
WebRTC.OnSubscription := DoJoin;
WebRTC.OnUnSubscription := DoLeave;
WSServer.Active := True;
// broadcast a JSON signalling payload to every peer in a channel
WebRTC.Broadcast('{"type":"offer","sdp":"..."}', 'room-42');
end;
5 published properties, 2 methods, 11 events — pulled from the component reference.
Methods: Broadcast, WriteData.
Events: OnConnect, OnDisconnect, OnError.
Published property WebRTC, holding IceServers and CloseSessionOnHangup. IceServers is a list of JSON text: what you put in it is spliced verbatim into the sgc@iceservers frame and handed straight to the browser RTCPeerConnection, so it has to be one complete RTCConfiguration object.
Published properties: Guid, Version.
Properties: Server, Broker.
Events: OnBeforeSubscription, OnSubscription, OnUnSubscription.
Authoritative sources for the protocols this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — Protocol_WebRTC Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\Protocols\WebRTC Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |