Skip to content

API Reference

EaseLive

new EaseLive(options)

Creates a new Ease Live Bridge on your web page. Throws an Error exception if a required parameter is missing.

AttributeDescriptionTypeRequired
logLevelWhich level of logging to apply (debug, info, error). Defaults to infoStringOptional
setupTimeoutTimeout in millisecond after which the overlay loading should error out. Defaults to 30000IntegerOptional
viewContainerWhich DOM element to render the Ease Live UI in. If blank, the player container will be used.String or DOM NodeOptional
playerPluginWhich player plugin to use. Either a function or an array where the first element is the function and the remaining elements are parametersFunction or ArrayRequired
viewPluginWhich view plugin to use. Defaults to xcomponentObjectOptional
accountIdAccount IDStringRequired
projectIdProject ID. If not set, it will load the project the program belongs toStringOptional
programIdProgram IDStringRequired
envWhich environment to load URL for. Use to load different URLs for "prod", "staging" and "dev". Defaults to "prod"StringOptional
keymappingMapping of keys used for spatial navigation in Smart TV projects. An Object where the property name is the value of key or keyCode in KeyboardEvent mapped to a value which is one of 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown', 'Enter', 'Back'. Example: {'Escape': 'Back', 87: 'ArrowUp'} to use Esc to navigate back, and W to navigate upObjectOptional
allowPermissionsCustom allow list for the iframe. If set to empty array, no permissions are given. By default the following permission are given: ['camera', 'microphone', 'clipboard-read', 'clipboard-write', 'fullscreen'].ArrayOptional
paramsParameters to the Ease Live web appObjectOptional
params.debugInstruct the web app to run in debug modeBooleanOptional
params.streamIdStream ID. Defaults to mainStringOptional

easeLive.options

Returns the options object that was provided at startup.

easeLive.use(plugin, options)

Installs a new plugin to the easeLive instance.

ParameterDescriptionTypeRequired
pluginAnonymous function, or object with install functionFunction/ObjectRequired
optionsConfiguration options specific to the plugin to be installedObjectOptional

easeLive.getPlayer()

Returns the player instance created by the player plugin.

easeLive.on(event, listener, fromSdkOnly)

Subscribe to an event. The callback handler will receive any attached metadata/payload. Events can be triggered by either the SDK itself, plugins, or by the connected web app.

Note that wildcards are supported.

ParameterDescriptionTypeRequired
eventEvent nameStringRequired
listenerCallback ran with event metadata as the first argument when event receivedFunctionRequired
fromSdkOnlyWhen true, only trigger on events emitted by the SDK/overlay, and ignore events from the app/custom plugins. When false, trigger on all emitted events. Defaults to falseBooleanOptional

easeLive.off(event, listener)

Unsubscribe an event listener that was previously added with easeLive.on.

ParameterDescriptionTypeRequired
eventEvent nameStringRequired
listenerCallbackFunctionRequired

easeLive.emit(event, data)

Send an event to the overlay.

ParameterDescriptionTypeRequired
eventEvent nameStringRequired
dataEvent metadataObjectOptional

easeLive.focus()

Move focus for spatial navigation to the EaseLive overlay.

easeLive.hasFocus()

Returns true if focus is currently within the EaseLive overlay.

easeLive.setProgram(options)

Loads a different program in the current instance.

AttributeDescriptionTypeRequired
accountIdAccount IDStringIf not set, it will use the one set in constructor
projectIdProject IDStringIf not set, it will load the project the program belongs to
programIdProgram IDStringRequired
envWhich environment to load URL for. Use to load different URLs for "prod", "staging" and "dev". Defaults to "prod"StringOptional
paramsParameters to the Ease Live web appObjectOptional

easeLive.setStream(options)

Updates the Stream ID during runtime. The overlay will automatically apply the stream’s timecode settings.

AttributeDescriptionTypeRequired
streamIdStream IDStringRequired

easeLive.destroy()

Removes the overlay and its event listeners. EaseLive should be destroyed before removing the DOM element passed as viewContainer. For example in React componentWillUnmount, Vue onBeforeUnmount, or equivalent.

Events

easelive.ready

Fired when overlay has completed loading.

easelive.error

Fired when any error occurs in the SDK or plugins. For separate error events by component, see Error events. The app should destroy the SDK on fatal errors. See Error handling.

ValueDescriptionType
typePossible values fatal, warningstring
messageHuman-readable description of the errorstring
codeOptional error codeinteger
programIdProgram ID if the error is related to subscribing to a programstring

Player

Events

player.ready

When the player has been initiated and is ready for playback, this event should be triggered. This is the point where the Ease Live View will be initialized.

ValueDescriptionTypeRequired
playerThe player instanceObjectOptional
playerContainerThe parent element which the view is to be attached. This will only be used if no viewContainer is configured (see EaseLive constructor)DOM Element or String identifierOptional

player.state

This event should be fired by the player plugin whenever the player state changes.

"state" is one of "playing", "paused", "stopped", "seeking" and "buffering". Required.

ValueDescriptionTypeRequired
stateThe new player stateStringRequired

player.time

This event should be fired by the player plugin whenever it reads the timecode of the current playback position. The timecodes should be milliseconds since 1970-01-01T00:00:00Z.

The initialTimecode and maxTimecode are optional. If not present the stream is considered to be a Live stream without a seekable buffer. If it's a live stream the initialTimecode and maxTimecode should be equal to the timecode.

ValueDescriptionTypeRequired
timecodeTimecode at current playback positionIntegerRequired
initialTimecodeTimecode at the start of the seekable windowIntegerOptional
maxTimecodeTimecode at the end of the seekable windowIntegerOptional

player.metadata

Fired when any additional metadata is received in the stream (optional).

The payload should contain the json-parsed payload of the tag embedded in the stream. It can have any number of name/value pairs.

player.speed

Sets or gets the playback speed of the player. Fast forward as well as slow motion is supported. Slow motion is used by values between 0 and 1, fast forward by values greater than 1.

ValueDescriptionTypeRequired
speedA playback speed factor greater than 0FloatRequired

player.volume

Sets or gets the player’s volume in the range of 0 (silent) to 100 (max volume).

ValueDescriptionTypeRequired
volumeThe volume to set between 0 and 100IntegerRequired

player.mute

Sets or gets the player’s audio mute.

ValueDescriptionTypeRequired
muteThe mute status, true or falseBooleanRequired

player.videoscale

Sets or gets the size and position of the player’s video surface. Values are relative to the original video size.

ValueDescriptionTypeRequired
scaleXHorizontal scale factor, between 0 and 1.FloatRequired
scaleYVertical scale factor, between 0 and 1.FloatRequired
pivotXHorizontal anchor for the scaling animation, between 0 and 1.FloatRequired
pivotYVertical anchor of the scaling animation, between 0 and 1.FloatRequired
durationDuration of the scale animation in milliseconds.IntegerRequired

player.controls

Emit when your player controls change visibility.

ValueDescriptionTypeRequired
controlsNew player controls visibility. Possible values visible, hiddenstringRequired

View

Events

view.ready

Fired when the view has been initiated, but not yet ready for bridge communication (see bridge.ready).

Receives an object with the following:

ValueDescriptionType
viewContainerThe DOM element the view is rendered toDOM Element
urlThe complete URL used for connecting to the Ease Live web appString

view.mouseenter

Fired when the mouse enters the EL container. Useful for e.g. showing player controls.

Bridge

Events

bridge.ready

Fired when the bridge communication layer has been initiated, after the web app has completed the initial load.

bridge.stage

Fired when your player controls should update its visibility and focus.

When user clicked on empty part of the overlay or pressed remote Back button at the root, controls value will be "visible":

  • set your player controls visible if they are not visible already.
  • if using spatial navigation (ie on a TV): set focus to some element inside the player controls.
  • optionally you can hide the element used as viewContainer to hide the overlay while player controls are visible, or just keep EaseLive visible behind the player controls.

When user clicks in the overlay while controls are visible or navigates into a new scene, controls value will be "hidden":

  • set your player controls hidden if they are not hidden already.
  • set EaseLive's viewContainer visible if it is not visible already.
  • if using spatial navigation (ie on a TV): set focus to EaseLive using easeLive.focus().
ValueDescriptionType
controlsNew player controls visibility. Possible values visible, hiddenstring

Application

app.ready

Fired when the overlay has finished loading in the UI and is up and running as expected.

app.status

Fired when the producer has changed status of the overlay. If the status is disabled the EaseLive instance can be destroyed. If using spatial navigation (ie on a TV), set focus back to the player controls when EaseLive is hidden or disabled.

ValueDescriptionType
statusNew status. Possible values enabled, hidden, disabledstring

Error events

view.error

Fired when the Bridge SDK doesn't manage to setup an iframe or webview.

ValueDescriptionType
typePossible values fatal, warningstring
messageHuman-readable description of the errorstring

bridge.error

Fired when the Bridge SDK doesn't manage to setup a communication channel between the Bridge and the web app.

ValueDescriptionType
typePossible values fatal, warningstring
messageHuman-readable description of the errorstring

app.error

Fired when something wrong happens during runtime, like missing data or scalability issues.

ValueDescriptionType
typePossible values fatal, warningstring
messageHuman-readable description of the errorstring
codeOptional error codeinteger
programIdProgram ID if the error is related to subscribing to a programstring