• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

ToiMediaRecorderBase

Class Summary

Extends:
  • ToiEventTarget
See also:
  • ToiMediaService
  • ToiMediaRecorder

The ToiMediaRecorderBase interface is the base interface for recorder instances. It contains only read-only methods and no control functionality.

  • Methods
  • Members
  • Types
  • Events

Method Summary

getContentId ( )  → contentId

Returns the unique content identifier for the recorded content. This identifier is recognized by the ToiContentService.

getParameter ( name )  → value

Get the current value of a parameter.

getParameters ( names )  → Array.<ToiMediaSession.ToiParameterInfo>

Get the values of several parameters.

getSessionId ( )  → id

Returns the session identifier. This identifier can be used to open a session object with ToiMediaService#openSession.

getState ( )  → state

Returns the current state of the media recorder instance.

getUrl ( )  → url

Returns the URL for the media stream.

releaseInstance ( )

This function releases the resources used by this instance. When this function returns all observers has also been released.

subscribeParameter ( eventListener , name )

This function makes the application subscribe to updates of a specific named parameter. The first time an application subscribes to a specific parameter there will be an immediate ToiMediaRecorderParameterChangedEvent notification if the parameter already has a value.

subscribeParameters ( eventListener , names )

This function makes the application subscribe to updates of the given list of parameters. The first time an application subscribes to a specific parameter there will be an immediate ToiMediaRecorderParameterChangedEvent notification if the parameter already has a value.

unsubscribeParameter ( eventListener , name )

This function undoes the effect of a previous call to ToiMediaRecorderBase#subscribeParameter. Any parameter that has not been subscribed to will simply be ignored.

unsubscribeParameters ( eventListener , names )

This function undoes the effect of a previous call to ToiMediaRecorderBase#subscribeParameters. Any parameters that has not been subscribed to will simply be ignored.

Inherited Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Type Definitions

ToiContentId (Type: string)

Identifier that uniquely identifies content. This maps to ToiContentService.ToiContentId.

ToiMediaRecorderState (Type: enum)

State identifier used to identify the media recorder state.

  • STATE_CONNECTING
  • STATE_FAILED
  • STATE_IDLE
  • STATE_PAUSED
  • STATE_RECORDING

Events

  • ON_PARAMETER_CHANGED
  • ON_STATE_CHANGED

Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Inherited From:

  • ToiEventTarget#addEventListener

Parameters:

Name Type Description
type number

The event type of the event to subscribe to.

listener ToiEventListener

The JavaScript function that will receive events.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.

getContentId ( )  → contentId

Returns the unique content identifier for the recorded content. This identifier is recognized by the ToiContentService.

Throws:

ToiSessionViolationException

Raised if the recorder is in ToiMediaRecorderBase.STATE_IDLE.

Returns:

The content identifier.

Type: ToiMediaRecorderBase.ToiContentId
getParameter ( name )  → value

Get the current value of a parameter.

See also:

  • ToiMediaRecorder#getParameters
  • ToiMediaRecorder#setParameter
  • ToiMediaRecorder#setParameters
  • ToiMediaRecorder#unsetParameter
  • ToiMediaRecorder#unsetParameters
  • ToiMediaRecorderBase#subscribeParameter
  • ToiMediaRecorderBase#subscribeParameters

Parameters:

Name Type Description
name string

Name of the requested parameter.

Throws:

ToiInvalidArgumentException

Raised if the parameter name is invalid or not recognized.

Returns:

The current value of the parameter.

Type: string
getParameters ( names )  → Array.<ToiMediaSession.ToiParameterInfo>

Get the values of several parameters.

See also:

  • ToiMediaRecorder#getParameter
  • ToiMediaRecorder#setParameter
  • ToiMediaRecorder#setParameters
  • ToiMediaRecorder#unsetParameter
  • ToiMediaRecorder#unsetParameters
  • ToiMediaRecorderBase#subscribeParameter
  • ToiMediaRecorderBase#subscribeParameters

Parameters:

Name Type Description
names Array.<ToiMediaSession.ToiParameterName> (Or a single ToiMediaSession.ToiParameterName.)

A list of parameter names. A single element can be passed directly and does not need to be passed in an array.

Returns:

A list of the returned parameters. If a parameter does not exist (is not set), the status of the corresponding parameter is set to ToiMediaSession.STATUS_NO_PARAMETER.

Type: Array.<ToiMediaSession.ToiParameterInfo>
getSessionId ( )  → id

Returns the session identifier. This identifier can be used to open a session object with ToiMediaService#openSession.

See also:

  • ToiMediaService#openSession

Throws:

ToiSessionViolationException

Raised if the recorder is in ToiMediaRecorderBase.STATE_IDLE.

Returns:

The session identifier.

Type: ToiMediaSession.ToiSessionId
getState ( )  → state

Returns the current state of the media recorder instance.

Returns:

The current recorder state.

Type: ToiMediaRecorderBase.ToiMediaRecorderState
getUrl ( )  → url

Returns the URL for the media stream.

Throws:

ToiSessionViolationException

Raised if the recorder is in ToiMediaRecorderBase.STATE_IDLE.

Returns:

The URL for the media stream.

Type: string
releaseInstance ( )

This function releases the resources used by this instance. When this function returns all observers has also been released.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Inherited From:

  • ToiEventTarget#removeEventListener

Parameters:

Name Type Description
type number

The event type of the event to remove the listener from.

listener ToiEventListener

The JavaScript function that was previously added as an event listener.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.

subscribeParameter ( eventListener , name )

This function makes the application subscribe to updates of a specific named parameter. The first time an application subscribes to a specific parameter there will be an immediate ToiMediaRecorderParameterChangedEvent notification if the parameter already has a value.

See also:

  • ToiMediaRecorderBase#subscribeParameters
  • ToiMediaRecorderBase#unsubscribeParameter
  • ToiMediaRecorderBase#unsubscribeParameters

Parameters:

Name Type Description
eventListener ToiEventListener

The eventListener that has been registered.

name string

The name of the parameter for which changes the application wants to subscribe to.

Throws:

ToiInvalidArgumentException

Raised if the address name is invalid or not registered.

subscribeParameters ( eventListener , names )

This function makes the application subscribe to updates of the given list of parameters. The first time an application subscribes to a specific parameter there will be an immediate ToiMediaRecorderParameterChangedEvent notification if the parameter already has a value.

See also:

  • ToiMediaRecorderBase#subscribeParameter
  • ToiMediaRecorderBase#unsubscribeParameter
  • ToiMediaRecorderBase#unsubscribeParameters

Parameters:

Name Type Description
eventListener ToiEventListener

The eventListener that has been registered.

names Array.<ToiMediaSession.ToiParameterName> (Or a single ToiMediaSession.ToiParameterName.)

The list of names of parameters. A single element can be passed directly and does not need to be passed in an array.

Throws:

ToiInvalidArgumentException

Raised if the address name is invalid or not registered.

ToiUnavailableException

Raised if the recoder is temporarily unavailable due to platform resource management.

unsubscribeParameter ( eventListener , name )

This function undoes the effect of a previous call to ToiMediaRecorderBase#subscribeParameter. Any parameter that has not been subscribed to will simply be ignored.

See also:

  • ToiMediaRecorderBase#unsubscribeParameters
  • ToiMediaRecorderBase#subscribeParameter
  • ToiMediaRecorderBase#subscribeParameters

Parameters:

Name Type Description
eventListener ToiEventListener

The eventListener that has been registered.

name string

The name of the parameter that the application is no longer interested in.

Throws:

ToiInvalidArgumentException

Raised if the address name is invalid or not registered.

unsubscribeParameters ( eventListener , names )

This function undoes the effect of a previous call to ToiMediaRecorderBase#subscribeParameters. Any parameters that has not been subscribed to will simply be ignored.

See also:

  • ToiMediaRecorderBase#unsubscribeParameter
  • ToiMediaRecorderBase#subscribeParameter
  • ToiMediaRecorderBase#subscribeParameters

Parameters:

Name Type Description
eventListener ToiEventListener

The eventListener that has been registered.

names Array.<ToiMediaSession.ToiParameterName> (Or a single ToiMediaSession.ToiParameterName.)

The list of parameter names. A single element can be passed directly and does not need to be passed in an array.

Throws:

ToiInvalidArgumentException

Raised if the address name is invalid or not registered.

ToiUnavailableException

Raised if the recorder is temporarily unavailable due to platform resource management.

Members

ON_PARAMETER_CHANGED (Type: ToiMediaRecorderParameterChangedEvent) (value = 1801) (static, constant)

This is an Event identifier for ToiMediaRecorderParameterChangedEvent.

Tells the observer that the value has changed for one of the parameters that the observer is subscribing to.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.ON_PARAMETER_CHANGED.
ON_STATE_CHANGED (Type: ToiMediaRecorderStateChangedEvent) (value = 1800) (static, constant)

This is an Event identifier for ToiMediaRecorderStateChangedEvent.

A call to this function tells the observer that the media recorder state has changed. The application is not notified this way about implicit state changes triggered by commands from the application itself.

Note that there is no timing constraint on these messages, and they may arrive late in certain situations. For example, the application may receive a call to this function about a state transition after the application has successfully called ToiMediaRecorder#close and thereby ended the session. This implies that the application should take calls to this function as indications to state transitions that has in fact happened, but it cannot say for certain when these state transitions occurred.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.ON_STATE_CHANGED.
STATE_CONNECTING (Type: ToiMediaRecorderBase.ToiMediaRecorderState) (value = 1) (static, constant)

In ToiMediaRecorderBase.STATE_CONNECTING the media recorder has an active session and is in the process of establishing a connection to a media stream source.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.STATE_CONNECTING.
STATE_FAILED (Type: ToiMediaRecorderBase.ToiMediaRecorderState) (value = 4) (static, constant)

In ToiMediaRecorderBase.STATE_FAILED the media recorder may or may not have a connection to a media source but the process of getting the stream from that source has failed in some fatal way.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.STATE_FAILED.
STATE_IDLE (Type: ToiMediaRecorderBase.ToiMediaRecorderState) (value = 0) (static, constant)

In ToiMediaRecorderBase.STATE_IDLE there is no active session. The media recorder does not handle a stream, and consequently has no connection to a media stream source. All functions requiring a session will raise a ToiSessionViolationException in ToiMediaRecorderBase.STATE_IDLE.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.STATE_IDLE.
STATE_PAUSED (Type: ToiMediaRecorderBase.ToiMediaRecorderState) (value = 2) (static, constant)

In ToiMediaRecorderBase.STATE_PAUSED the media recorder has a connection to a media source but is not yet recording the stream.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.STATE_PAUSED.
STATE_RECORDING (Type: ToiMediaRecorderBase.ToiMediaRecorderState) (value = 3) (static, constant)

In ToiMediaRecorderBase.STATE_RECORDING the media recorder has a connection to a media source and records the stream.

This constant can also be accessed from toi.consts.ToiMediaRecorderBase.STATE_RECORDING.

Events

ON_PARAMETER_CHANGED ( )

This is an Event identifier for ToiMediaRecorderParameterChangedEvent.

Value: 1801

ON_STATE_CHANGED ( )

This is an Event identifier for ToiMediaRecorderStateChangedEvent.

Value: 1800

5.1.1.p8

Copyright (c) 2018 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.