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

ToiDrmService

Class Summary

Extends:
  • ToiEventTarget
See also:
  • ToiDrmObserver

The ToiDrmService provides application access to the DRM service.

Service:

This is a service and can be accessed through toi.drmService
  • Methods
  • Members
  • Types
  • Events

Method Summary

getAudioOutputRestrictions ( sessionId )  → Array.<ToiDrmService.ToiAudioOutputRestriction>

Returns the current audio output restrictions for a specific session.

getVideoOutputRestrictions ( sessionId )  → Array.<ToiDrmService.ToiVideoOutputRestriction>

Returns the current video output restrictions for a specific session.

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

ToiAudioOutputType (Type: enum)

Data type used for identifying audio output type.

  • AUDIO_OUTPUT_TYPE_ANALOG
  • AUDIO_OUTPUT_TYPE_HDMI
  • AUDIO_OUTPUT_TYPE_SPDIF
ToiAudioRestriction (Type: enum)

Data type used for identifying restrictions on audio output. This type should be used as a bitmask as defined below.

  • AUDIO_RESTRICTION_NO_COMPRESSED
  • AUDIO_RESTRICTION_NO_UNCOMPRESSED
ToiVideoOutputType (Type: enum)

Data type used for identifying video output type.

  • VIDEO_OUTPUT_TYPE_ANALOG
  • VIDEO_OUTPUT_TYPE_HDMI
ToiVideoRestriction (Type: enum)

Data type used for identifying restrictions on video output. This type should be used as a bitmask as defined below.

  • VIDEO_RESTRICTION_MUTE

Events

  • ON_AUDIO_OUTPUT_RESTRICTIONS_CHANGED
  • ON_VIDEO_OUTPUT_RESTRICTIONS_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.

getAudioOutputRestrictions ( sessionId )  → Array.<ToiDrmService.ToiAudioOutputRestriction>

Returns the current audio output restrictions for a specific session.

Parameters:

Name Type Description
sessionId ToiMediaSession.ToiSessionId

The media session for which the restrictions are requested.

Throws:

ToiInvalidArgumentException

The media session identifier is invalid.

Returns:

The sequence of audio output restrictions.

Type: Array.<ToiDrmService.ToiAudioOutputRestriction>
getVideoOutputRestrictions ( sessionId )  → Array.<ToiDrmService.ToiVideoOutputRestriction>

Returns the current video output restrictions for a specific session.

Parameters:

Name Type Description
sessionId ToiMediaSession.ToiSessionId

The media session for which the restrictions are requested.

Throws:

ToiInvalidArgumentException

The media session identifier is invalid.

Returns:

The sequence of video output restrictions.

Type: Array.<ToiDrmService.ToiVideoOutputRestriction>
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.

Members

ON_AUDIO_OUTPUT_RESTRICTIONS_CHANGED (Type: ToiDrmAudioOutputRestrictionsChangedEvent) (value = 3700) (static, constant)

This is an Event identifier for ToiDrmAudioOutputRestrictionsChangedEvent.

Invoked when the audio output restrictions for a session have changed.

This constant can also be accessed from toi.consts.ToiDrmService.ON_AUDIO_OUTPUT_RESTRICTIONS_CHANGED.
ON_VIDEO_OUTPUT_RESTRICTIONS_CHANGED (Type: ToiDrmVideoOutputRestrictionsChangedEvent) (value = 3701) (static, constant)

This is an Event identifier for ToiDrmVideoOutputRestrictionsChangedEvent.

Invoked when the video output restrictions for a session have changed.

This constant can also be accessed from toi.consts.ToiDrmService.ON_VIDEO_OUTPUT_RESTRICTIONS_CHANGED.
AUDIO_OUTPUT_TYPE_ANALOG (Type: ToiDrmService.ToiAudioOutputType) (value = 2) (static, constant)

Analog audio output.

This constant can also be accessed from toi.consts.ToiDrmService.AUDIO_OUTPUT_TYPE_ANALOG.
AUDIO_OUTPUT_TYPE_HDMI (Type: ToiDrmService.ToiAudioOutputType) (value = 1) (static, constant)

HDMI audio output.

This constant can also be accessed from toi.consts.ToiDrmService.AUDIO_OUTPUT_TYPE_HDMI.
AUDIO_OUTPUT_TYPE_SPDIF (Type: ToiDrmService.ToiAudioOutputType) (value = 0) (static, constant)

SPDIF audio output.

This constant can also be accessed from toi.consts.ToiDrmService.AUDIO_OUTPUT_TYPE_SPDIF.
AUDIO_RESTRICTION_NO_COMPRESSED (Type: ToiDrmService.ToiAudioRestriction) (value = 2) (static, constant)

No compressed audio.

This constant can also be accessed from toi.consts.ToiDrmService.AUDIO_RESTRICTION_NO_COMPRESSED.
AUDIO_RESTRICTION_NO_UNCOMPRESSED (Type: ToiDrmService.ToiAudioRestriction) (value = 1) (static, constant)

No uncompressed or analog audio.

This constant can also be accessed from toi.consts.ToiDrmService.AUDIO_RESTRICTION_NO_UNCOMPRESSED.
VIDEO_OUTPUT_TYPE_ANALOG (Type: ToiDrmService.ToiVideoOutputType) (value = 0) (static, constant)

Analog video output.

This constant can also be accessed from toi.consts.ToiDrmService.VIDEO_OUTPUT_TYPE_ANALOG.
VIDEO_OUTPUT_TYPE_HDMI (Type: ToiDrmService.ToiVideoOutputType) (value = 1) (static, constant)

HDMI video output.

This constant can also be accessed from toi.consts.ToiDrmService.VIDEO_OUTPUT_TYPE_HDMI.
VIDEO_RESTRICTION_MUTE (Type: ToiDrmService.ToiVideoRestriction) (value = 1) (static, constant)

Mute video.

This constant can also be accessed from toi.consts.ToiDrmService.VIDEO_RESTRICTION_MUTE.
ToiAudioOutputRestriction (Type: struct) (static)

Audio output restriction data structure.

Struct fields

Name Description
output

Audio output.

Type: ToiDrmService.ToiAudioOutputType
restrictionMask

Audio restriction mask. ToiDrmService.ToiAudioRestriction defines the allowed values.

Type: number

ToiVideoOutputRestriction (Type: struct) (static)

Video output restriction data structure.

Struct fields

Name Description
output

Video output.

Type: ToiDrmService.ToiVideoOutputType
restrictionMask

Video restriction mask. ToiDrmService.ToiVideoRestriction defines the allowed values.

Type: number

Events

ON_AUDIO_OUTPUT_RESTRICTIONS_CHANGED ( )

This is an Event identifier for ToiDrmAudioOutputRestrictionsChangedEvent.

Value: 3700

ON_VIDEO_OUTPUT_RESTRICTIONS_CHANGED ( )

This is an Event identifier for ToiDrmVideoOutputRestrictionsChangedEvent.

Value: 3701

5.1.1.p8

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