OTN Video JavaScript Library version 0.1.18 September 2019


0.1.182 years ago4 years agoMinified + gzip package size for @otn/otn-video in KB


OTN Video JavaScript Library version 0.1.18 September 2019

The OTN video JavaScript Library allows third-party vendors to use the OTN video network to easily and efficiently add video capability to their desktop web applications.

Features Supported

  • Join a session that was previously created by OTN’s video API startCall(sessionId, videoContainerId, userDisplayName, apiUrl, onSuccess,onError)
     sessionId - sessionId is retrieved from OTN VIDEO API
     videoContainerId - html id of the video container
     userDisplayName - display name
     apiUrl - OTN Video service URL
     onSuccess - success callback , invoked if call was successfully started
     onSuccess - error callback , invoked if call was failed to start
     onDisconnect - invoked if the participant has been disconnected.
     devices - pre-selected camera/speaker/mic
     onParticipantCreate - invoked when new participant join to the call
     onParticipantUpdate - invoked when participant get updated
     onParticipantDelete - invoked when participant leave the call
     onConferenceUpdate - callback for any conference updates , for example conference is locked
     pin - mandatory, either guest pin or host pin, can be set on video resource, if not set host pin will be autogenerated and return as part of the VVR payload (.pin = guest pin, .hostPin= host pin)
  • Disconnect from a session
  • Mute/unmute the users's microphone, camera, or speaker
  • Turn on full screen mode
  • Set/Get camera/microphone/speaker (WebRTC only)
  • Get cameras/microphones/speakers, the methods returns list of devices, each device has 'id' and 'label' property, use 'id' property of the device to switch it.
  • Get participants, returns list of the partcipants, each participant has 'uuid' and 'name' value
  • changeSelfViewMode - options are "None", "PIP", "Dock", only chrome supports it, flash supports only "None", "PIP"
  • Callbacks
    • conferenceStarted - invoked by library after a conference has been started ,NOTE: This callback will be depricated , use onSuccess callback in startCall API.
  • cancelJoin method is invoked when user want to stop call initiation of already started call.
  • isSupportDeviceConfiguration method returns true if browser supports device configuration during the call, else returns false (in case of the flash the device configuration is done through native flash popup to set camera/mic/speaker)
  • startMirrorTest(params, onSuccess, onFailure) params:
     apiUrl - Middle tier service URL
     userDisplayName - display name (optional)
     onDisconnect(reason) - invoked when client was disconnected externally (not by user's action)
    onSuccess - success callback onFailure - failure callback
  • Content Sharing
    • isContentShareSupported() - Returns true if sharing content is supported on your browser, false otherwise.
    • startContentShare(onSuccess, onFailure) - Allows user to select window or screen to share. Function onFailure called with an object of the form {code, message, extensionUrl}. Possible codes: E_SHARE_NOTINCONF, E_SHARE_NOTSUPPORTED, E_SHARE_VIDEONOTINITIALIZED, E_SHARE_NOEXTENSIONCHROME, E_SHARE_ALREADYSHARING If E_SHARE_NOEXTENSIONCHROME is returned, the field extensionUrl contains a URL to download the extension.
    • stopContentShare(onSuccess, onFailure) - Stops sharing window or screen. Function onFailure called with an object of the form {code, message}. Possible codes: Possible codes: E_SHARE_NOTINCONF, E_SHARE_NOTSUPPORTED, E_SHARE_VIDEONOTINITIALIZED, E_SHARE_NOTSHARING
    • isSharingContent() - Returns true if you are sharing content, false otherwise.
    • isViewingSharedContent() - Returns true if you are currently viewing shared content (that another user is sharing)
    • getViewContentShareMode() - Returns the supported mode for viewing shared content - one of: "IMAGE", "VIDEO", or undefined.
  • isMuteSpeakerSupported - returns true/false
  • isDeviceSwitchInCallSupported - returns true/false ( false for IE/Safari <11, since it uses flash to switch camera/mic)
  • isUsingFlash - Returns true if this video implementation is using Flash
  • isFlashInstalled - Returns true if Flash is installed and enabled in the browser

Protocols and APIs Supported

  • WebRTC video (for browsers that support it)
  • Flash plugin (for redundancy)
  • supports pexip v19 platform


Contact OTN and request the following: 1. Video API URL 2. API key and shared secret (part of provisioning for OTN infrastructure)


  1. By default library is distributed with PexVideo.swf located in 'dist' folder, to change location 'pexipVideoFlash' property need to be updated.

To install, run: npm install @otn/otn-video

Copyright 2020 Ontario Telemedicine Network (OTN) All rights reserved.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.