1.0.1 • Public • Published



Set of Videojs plugins for playing streams from the Ceeblue cloud.

This plugin contains :

Table of Contents


Download the package from @ceeblue/videojs-plugins or build it manually from the github sources :

npm install
npm run build

Include @ceeblue/videojs-plugins in your HTML code as usual with the link to Videojs and this library.

Example :

<script src="https://vjs.zencdn.net/8.7.0/video.min.js"></script>
<script src="./dist/videojs-plugins.js"></script>




The src field contains the URL of the WebRTC endpoint.

The protocol can be WebSocket (wss) to get the best of the custom Ceeblue signaling or HTTP (https) to use the standard WHEP signaling protocol.

Here is the expected format :


And here is an example of a complete WebSocket URL:


The following options can be set in the query:

  • id : The string token in case the stream is private.

  • audio : the audio track ID or none to disable audio.

  • video : the video track ID or none to disable video.


It is important for the MIME-type to be empty to use the WebRTC source.


Ice-server structure in JSON string format with TURN URL used to establish the WebRTC connection, mainly for TCP fallback.

Do not enclose the object in an array. If you have multiple TURN servers, you can add them in the urls array. If not set, the plugin will use the default TURN server of the Ceeblue Cloud.


Replace <ceeblue-host> by your endpoint hostname

  "urls": ["turn:<ceeblue-host>?transport=tcp", "turn:<ceeblue-host>:3478"],
  "username": "csc_demo",
  "credential": "UtrAFClFFO"


false to disable the WebRTC audio track selection button, true by default.


true to listen to all timed metadata tracks, false otherwise. true by default.

This has no effect on the player, to get the timed metadatas in your application you must use the textTracks() API of Videojs, you can check examples/player.html for an example of usage.

Source Object

Call the player.src() method with a WebRTC URL.


Replace <ceeblue-host> by your endpoint hostname and <streamId> by your stream name.

<script type="module">
  import {} from "/path/to/video.min.js";
  import {} from "/path/to/ceeblue/videojs-plugins.min.js";
  const player = videojs('video-tag');
    src: 'wss://<ceeblue-host>/<streamId>',
    iceserver: '{
      "urls": ["turn:<ceeblue-host>?transport=tcp", "turn:<ceeblue-host>:3478"],
      "username": "csc_demo",
      "credential": "UtrAFClFFO"
    audiobutton: true,
    data: false

<source> HTML tag

The WebRTC source can be set directly in the HTML Source tag.


Replace <ceeblue-host> by your endpoint hostname and <streamId> by your stream name.

<script src="//path/to/video.min.js"></script>
<script src="//path/to/ceeblue/videojs-plugins.min.js"></script>

<div id="video_container">
    <video id=video-player width=960 height=540 class="video-js vjs-default-skin" controls>
        <source src="wss://<ceeblue-host>/webrtc/<streamId>" 
            iceserver='{"urls": ["turn:<ceeblue-host>?transport=tcp", "turn:<ceeblue-host>:3478"], "username": "csc_demo", "credential": "UtrAFClFFO"}'>
  var player = videojs('video-player');


If you are not using the SourceController, the QualityButton plugin can be called with a simple command to create the video menu button using the qualityLevels of the current source (see videojs-contrib-quality-levels):

  var player = videojs('video-player');


The SourceController allows to configure fallback sources when the current source is not working (for example if WebRTC is not supported in the browser). It is also suited to switch smoothly from one source to the other.

The constructor of SourceController only takes one argument : the videojs player.

To start the SourceController call the start() function with the following arguments :

  • The ConnectParams structure containing the host, the stream name, the access token (optional) and the query parameters (optional),
  • The list of sources in order of priority. A source can be a string from the SourceType list or a Source Object in order to set custom options.

See SourceType object in SourceController.js which defines the list of possible sources, The Source Object must contain the src field and the type field set to the MIME-type of the source (empty for WebRTC, see WebRTCSource).


Replace <ceeblue-host> by your endpoint hostname and <streamId> by your stream name.

  const sourceController = new SourceController(
  sourceController.on('sourcechanged', (source) => {
    console.log('sourcechanged', source); // null means no more sources available
      host: '<ceeblue-host>',
      streamName: '<streamId>'
      query: 'id=<accessToken>'
        // A WebRTC source with custom options
        src: 'wss://<ceeblue-host>/<streamId>',
        iceserver: '{"urls": ["turn:<ceeblue-host>?transport=tcp", "turn:<ceeblue-host>:3478"], "username": "csc_demo", "credential": "UtrAFClFFO"}',
        // A fallback source with a custom type
        src: 'http://vjs.zencdn.net/v/oceans.mp4',
        type: 'video/mp4'

Disabling QualityButton

By default the SourceController creates a QualityButton for the current source but you can disable it in the player's options with the qualityButton option:

const player = videojs(videoEl, { qualityButton: false});


You can find examples of players in the examples/ directory :

  • player.html : The most advanced example which use WebRTC, the SourceController, and the QualityButton, with a complete UI for setting parameters and showing timed metadatas.
  • simple-player.html : A simple example using SourceController with default parameters.
  • webrtc-player.html : A simple example with a WebRTC source configured with the HTML <source> tag.

In all examples you can find the HTML code to include the library and the player, and the JavaScript code to configure the player. You can set query parameters in the URL to test the different options. For example :

Replace <ceeblue-host> by your endpoint hostname, <streamId> by your stream name and replace <accessToken> by the viewer access token given by Ceeblue Cloud API (optional, only if the stream is private).



This monorepo also contains built-in documentation about the APIs in the library, which can be built using the following npm command:

npm run docs

You can access the documentation by opening the index.html file in the docs folder with your browser (./docs/api/index.html).


All contributions are welcome. Please see our contribution guide for details.


By contributing code to this project, you agree to license your contribution under the GNU Affero General Public License.

Package Sidebar


npm i @ceeblue/videojs-plugins

Weekly Downloads






Unpacked Size

562 kB

Total Files


Last publish


  • thomasjammet
  • mathieupoux
  • serhii.marchuk
  • jobl