Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



52 Commits

Repository files navigation

WebRTC Javascript library

WebRTC JavaScript publisher library allows adding WebRTC publishing capabilities to your web pages. It uses WHIP signaling.

Use its code in your projects or take it as is for embedding into your pages to connect your users to Nimble Streamer. To learn more about server setup, read WebRTC setup article.

The following codecs can be used:

Specific codecs can be set via "videocodecs" parameter is WHIP URL.

Use demo publishing page to publish to your Nimble Streamer instance.

Getting Started

Add library to HTML

<script defer="defer" src="e32af6a81c16a82154b7.bundle.js"></script>


var config = {
  whipUrl: ''
var publisher = new WebRTCjs(config);

Full example

<!DOCTYPE html>
    <script defer="defer" src="e32af6a81c16a82154b7.bundle.js"></script>
    <script type="text/javascript">
      document.addEventListener("DOMContentLoaded", function(event) {
        var config = {
          whipUrl: '',
        var publisher = new WebRTCjs(config);

Configuration options

  • whipUrl - publishing URL with authorization parameters.
  • logLevel - the log level: info, or error.
  • videoElement - <video> tag to local monitoring published stream.
  • videoSelect - <select> tag with available cameras.


  • onPublisherCreated - called when publisher instance has been created with the provided configuration. Parameters: settings.
  • onConnectionStateChange - called when connection state has changed. Parameters: connectionState.
  • onOffer - called when SDP offer is ready. Parameters: offer.
  • onAnswer - called when server answer has been received. Parameters: answer.
  • onConnectionError - called if connection error happens. Has no parameters.

Callback usage example

var config = {
  whipUrl: '',

  onPublisherCreated: function(settings){ console.log('Ready to WebRTC publishing'); }

Related documentation