Skip to main content
Skip table of contents

Output control

Output control functionality allows operators to apply usage rules for premium content to comply with their contracts with studios. Depending on the device and the technology, the rules can vary. The SDK receives usage rule metadata that is extracted from the licence and enforces the rule as required.

There are a number of output control licence usage rules that can be set on content to affect how that content is displayed on external devices or when being played on a compromised device. The following sections describe the different use cases.

The OutputControlListener interface defines how the SDK exposes notifications of events related to output control.

Access status is reflected in the values obtained from the OutputControlListener interface's onAccessStateChanged signal, or from calling OutputController.getOutputController().getAccessState(), which returns one of the following values:

Device TypeEnumeration
ACCESS_STATE_NO_LIMITATION0
ACCESS_STATE_BITRATE_LIMIT1
ACCESS_STATE_RESOLUTION_LIMIT2
ACCESS_STATE_RESTRICTIVE3
ACCESS_STATE_BLOCKED4

Example code

  • For blocked content, the application may have to indicate to the user that this condition has been met.
  • For restricted content, the application should blank the connected external display.

The following example code covers both of these scenarios:

JAVA
private final static class BlankPresentation extends Presentation {
private GLSurfaceView mSurfaceView;

public BlankPresentation(Context context, Display display) {
  super(context, display);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
  // Be sure to call the super class.
  super.onCreate(savedInstanceState);
  Resources r = getContext().getResources();
  // Inflate the layout.
  setContentView(R.layout.about_view);
}
}

...

private OutputControlListener mOutputControlListener = new OutputControlListener() {
@Override
public void onDeviceConnected(int i) {
  NMPLog.d(TAG, "OutputControlListener::onDeviceConnected");
  mDeviceConnected = i;
}

@Override
public void onDeviceDisconnected(int i) {
  NMPLog.d(TAG, "OutputControlListener::onDeviceDisconnected");
  if(mDeviceConnected == i){
    mDeviceConnected = OutputController.OUTPUT_DEVICE_LOCAL;
  }
}

...

public void onAccessStateChanged(int i) {
  NMPLog.d(TAG, "OutputControlListener::onAccessStateChanged,state: " + OutputController.getOutputController().getAccessState());
  if(i == OutputController.ACCESS_STATE_BLOCKED) {
    PlaybackActivity pa = (PlaybackActivity) getActivity();
    pa.onInfo("Output Control Limitation", "Playback Blocked : Disconnect "+mConnectedDeviceName[mDeviceConnected]);
  } else if (i == OutputController.ACCESS_STATE_RESTRICTIVE) {
    MediaRouter mediaRouter = (MediaRouter) mContext.getSystemService(Context.MEDIA_ROUTER_SERVICE);
    MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute(0);
    if (route != null) {
      Display presentationDisplay = route.getPresentationDisplay();
      if (presentationDisplay != null) {
        Presentation presentation = new BlankPresentation(mContext, presentationDisplay);
        presentation.show();
      }
    }
  }
}

Compromised devices

Usage rules enforce access to content on compromised devices in the following ways:

  • No control
    Where a user selects content where the licence usage rule does not block, the content can be played.
  • Blocked
    The user selects content where the licence usage rule requires blocking. The licence is not granted and playback does not start.
  • Bitrate capped
    The user selects content where the licence usage rule requires bitrate capping. Here, the content can be played at or below the bitrate cap.
  • Resoution capped
    The user selects content where the licence usage rule requires resolution capping. The content can be played at or below the resolution cap.

Mirroring (casting)

When mirroring (casting) is used, usage rules are applied as follows. This is explained in more detail below.

Usage ruleAlready mirroring when content selectedMirroring started after content selectedMirroring disconnected
BlockingPlayback does not start on the device or mirror.Playback is paused on device and mirror.Already mirroring when content selected: Playback is paused on the device until play is pressed.
Mirroring started after content was selected: Playback resumes on the device.
No controlPlayback starts on the device and mirror.Playback continues on the device and mirror.Playback continues on the device.

Digital display

Devices can be considered secure (HDCP compliant) or non-secure (non-HDCP compliant). Usage rules enforce the access to content being displayed via digital output in the following ways:

  • Blocked
  • Bitrate capped
  • Resolution capped
  • Restricted
  • No control

HDCP is enabled on the Android platform, so in most cases HDCP is always applied automatically. However, non-HDCP devices are also catered for. There are several variations in the digital display usage rules – these are separated into sub-sections for HDCP and non-HDCP, with each having a scenario for connecting before or after playback of content for each of the variations in the usage rule.

HDCP enabled device

Usage ruleDisplay already connected when content selectedDisplay connected after content selectedWhen display disconnected
BlockingPlayback does not startPlayback is pausedPlayback resumes on device
Bitrate cappedPlayback starts on device only, no output to external displayPlayback continues on device only, no output to external displayPlayback continues on device only
Resolution cappedPlayback starts on device only, no output to external displayPlayback continues on device only, no output to external displayPlayback continues on device only
RestrictedPlayback starts unaffectedPlayback continues unaffectedPlayback continues unaffected
No controlPlayback starts unaffectedPlayback continues unaffectedPlayback continues unaffected

Non-HDCP enabled device

Usage ruleDisplay already connected when content selectedDisplay connected after content selectedWhen display disconnected
BlockingPlayback does not startPlayback is pausedPlayback resumes on device
Bitrate cappedPlayback forcibly adapted down to be within limitPlayback forcibly adapted down to be within limitLimit is lifted
Resolution cappedPlayback forcibly adapted down to be within limitPlayback forcibly adapted down to be within limitLimit is lifted
RestrictedPlayback starts on device only, no output to external displayPlayback continues on device only, no output to external displayPlayback continues on device only
No controlPlayback starts unaffectedPlayback continues unaffectedPlayback continues unaffected
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.