Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.19 KB

examples-webrtc-html.md

File metadata and controls

29 lines (24 loc) · 1.19 KB

WebRTC HTML Client Example

The HTML page implements a simple WebRTC Client script to demonstrate the use of DSL's Websocket Server and WebRTC Sink APIs. The client can be used with the following Python examples.

Important Note: The current WebRTC implementation is based on the webrtcbin plugin only available with GStreamer 1.18 or later.

The javascript implements two browser window functions:

window.onload

Opens a Websocket connection using the following configuration parameters

var config = { 'iceServers': [{ 'urls': 'stun:stun.l.google.com:19302'}] }
var wsHost = "localhost"; 
var wsPort = 60001; 
var wsPath = "ws"; 

window.onbeforeunload

Closes the Websocket connection - before the browser window unloads - on window/tab close.

The script implements the following WebRTC signaling functions.

  • onLocalDescription
  • onIncomingSDP
  • onIncomingICE
  • onTrack
  • onIceCandidate
  • onDataChannel