Global

Members

(constant) builtInConfig :builtInConfig

Type:

(constant) getVideoContentHint

Returns contentHint for videoTrack of MediaStream

(constant) setVideoContentHint

Sets contentHint for videoTrack of MediaStream

Methods

Name Description
castToBoolean(The) → {Boolean}
getDelayForProbeNumber() The network probes will be run at backing off time intervals e.
getMediaSectionsForAnswer(partialRemoteAnswer, currentRemoteDescription) → {Array.<Array.<string>>}
getMediaSectionsForOffer(partialRemoteOffer, currentRemoteDescription)
getPartialIceRestartSdpOffer(offer)
getPartialSdpAnswer(newAnswer, newMids) → {ParsedSdp}
getSessionInfo(config) → {Promise.<SessionInfo>}
getSessionInfoFactory(dependencies) → {getSessionInfo}
mapErrorCodeToName(code) → {string|undefined} Maps an error from SessionInfo.
mapStatusCodeToErrorCode(code) → {string|undefined}
(package) NativeVideoElementWrapperFactory(depsopt)
ReusableElementArray() → {ReusableElementArray} ReusableElementArray is a wrapper for a conventional array.
(package) VideoElementFacadeFactory(dependenciesopt) → {VideoElementFacade}
waitForCorrectResolution(videoElementFacade, timeoutMs) Returns a Promise that will resolve when the video resolution is greater than 2 in either dimension, or a timeout occurs.
waitForVideoToBePlaying(videoElementFacade, maxWaitTime)
weakMemoizeBind(fn, context) This method needs to memoize fns with their context, this is so that calls to off will have the same identity to the calls to on.
(package) WidgetViewFactory(deps)

castToBoolean(The) → {Boolean}

castToBoolean
Parameters:
Name Type Description
The any value to cast
Returns:
True if value === 'true' or value === true, otherwise false.
Type
Boolean

getDelayForProbeNumber()

The network probes will be run at backing off time intervals e.g. 30s, 60s, 120s, 120s and so on. This function takes the current probe count and returns the needed delay in ms. e.g. after 2 failed probes, we run the 3rd probe. Probe count 3 -> 120s.

getMediaSectionsForAnswer(partialRemoteAnswer, currentRemoteDescription) → {Array.<Array.<string>>}

Construct the full SDP media section array combining the mantis partial answer and current local description
Parameters:
Name Type Description
partialRemoteAnswer * partial answer SDP from mantis
currentRemoteDescription * current remote description on PC
Returns:
- An array of mediaSection arrays
Type
Array.<Array.<string>>

getMediaSectionsForOffer(partialRemoteOffer, currentRemoteDescription)

Reconstructs the media section array for the full remote offer SDP from mantis from a partial offer by combining it with the current remote description
Parameters:
Name Type Description
partialRemoteOffer ParsedSdp
currentRemoteDescription ParsedSdp
Returns:
SDP in string format

getPartialIceRestartSdpOffer(offer)

creates a partialSdp object with header and first mediaSection only
Parameters:
Name Type Description
offer ParsedSdp new remote offer generated by PC
Returns:
partialSdp containing new header and first mediaSection only

getPartialSdpAnswer(newAnswer, newMids) → {ParsedSdp}

Construct partialSdp answer with only header and new track media sections
Parameters:
Name Type Description
newAnswer ParsedSdp full local remote answer from the PC
newMids Array.<string> array of mids of tracks added in this operation
Returns:
partialSdp - partialSdp containing only the new headers and the media sections of the new tracks.
Type
ParsedSdp

getSessionInfo(config) → {Promise.<SessionInfo>}

getSessionInfo - Fetch session details from Anvil and return a SessionInfo object
Parameters:
Name Type Description
config getSessionInfoConfig
Returns:
The session info
Type
Promise.<SessionInfo>

getSessionInfoFactory(dependencies) → {getSessionInfo}

Factory for injecting dependencies into and returning a getSessionInfo function
Parameters:
Name Type Description
dependencies getSessionDependencies
Returns:
Type
getSessionInfo

mapErrorCodeToName(code) → {string|undefined}

Maps an error from SessionInfo.get to its corresponding name
Parameters:
Name Type Description
code number Error code
Returns:
Error name
Type
string | undefined

mapStatusCodeToErrorCode(code) → {string|undefined}

Maps an Anvil status code error to an exception code
Parameters:
Name Type Description
code number Anvil status code
Returns:
Exception code
Type
string | undefined

(package) NativeVideoElementWrapperFactory(depsopt)

NativeVideoElementWrapperFactory DI container
Parameters:
Name Type Attributes Default Description
deps any <optional>
{}

ReusableElementArray() → {ReusableElementArray}

ReusableElementArray is a wrapper for a conventional array. This wrapper does not remove elements in the array, it nulls them instead. When an element is nulled, its space is considered free. Thus it can be reused by the next addition to the array. This array never shrinks.
Returns:
Object
Type
ReusableElementArray

(package) VideoElementFacadeFactory(dependenciesopt) → {VideoElementFacade}

VideoElementFacadeFactory DI Container for VideoElementFacade
Parameters:
Name Type Attributes Description
dependencies Object <optional>
Properties
Name Type Attributes Description
NativeVideoElementWrapper NativeVideoElementWrapper <optional>
Returns:
Type
VideoElementFacade

waitForCorrectResolution(videoElementFacade, timeoutMs)

Returns a Promise that will resolve when the video resolution is greater than 2 in either dimension, or a timeout occurs.
Parameters:
Name Type Description
videoElementFacade typeVideoElementFacade
timeoutMs Number
Returns:
Promise true if resolution succeeded, false otherwise

waitForVideoToBePlaying(videoElementFacade, maxWaitTime)

Wait for the video to be playing
Parameters:
Name Type Default Description
videoElementFacade typeVideoElementFacade
maxWaitTime Number 5000
Returns:
Promise true if we think the video is playing, false if we timeout

weakMemoizeBind(fn, context)

This method needs to memoize fns with their context, this is so that calls to off will have the same identity to the calls to on.
Parameters:
Name Type Description
fn function
context object

(package) WidgetViewFactory(deps)

WidgetViewFactory - DI factory for WidgetView
Parameters:
Name Type Description
deps Object
Properties
Name Type Description
VideoElementFacade DefaultVideoElementFacadeFactory
Returns:
WidgetView

Type Definitions

builtInConfig

properties that are baked in and are injected through webpack
Type:
  • Object
Properties:
Name Type Description
version String Build version (comes from package.json)
buildHash String Commit hash this build was built from
minimumVersion Object
Properties
Name Type Description
firefox String Minimum version of Firefox needed to support OpenTok
chrome String Minimum version of Chrome needed to support OpenTok
debug Boolean If true sets logging level to DEBUG else sets it to WARN
websiteURL String Used to construct urls to the TokBox website
loggingURL String Where to send analytical events
apiURL String The API to talk to (Anvil)

getSessionDependencies

Configuration
Type:
  • Object
Properties:
Name Type Attributes Description
anvilUrl String The base anvil url
sessionId String The id of the session to retrieve info for
token String The token used for authentication
clientVersion String The client version passed to Anvil
connectionId String The connection id passed to Anvil
axios String <optional>

getterSetterDefinition

Properties:
Name Type Description
get function the function called when accessing the value
set function the function called when setting the value

Logger

Type:
  • Object
Properties:
Name Type Description
error function
warn function
info function
log function
debug function
spam function

peerConnectionMeta

Type:
  • Object
Properties:
Name Type Description
remoteConnectionId String The connection id of the remote side
remoteSubscriberId String The subscriber id of the remote side
peerId String The peerId of this peer connection
peerConnectionId String Our local identifier for this peer connection

PublisherPeerConnectionConfig

Type:
  • object
Properties:
Name Type Description
logAnalyticsEvent function
remoteConnection Connection
reconnection boolean
webRTCStream MediaStream
channels object.<string, object>
capableSimulcastStreams boolean
overrideSimulcastEnabled boolean
subscriberUri string
offerOverrides object.<string, object>
answerOverrides object.<string, object>
sourceStreamId string
isP2pEnabled string

videoFrameStatValues

Calculates the video framerate based on current and last frames, and current and last stat timestamp.
Type:
  • Object
Properties:
Name Type Description
currentStatFrames Number Frames taken from current stats.
currentTimestamp Number Timestamp taken from current stats.
prevStatFrames Number Frames taken from previous stats.
prevTimestamp Number Timestamp taken from previous stats.