Playback Restrictions with Live Streams

In this topic, you will learn how to use Playback Restrictions with Live streams.

Introduction

Playback Restrictions can be enabled for a Live job to extend the protections provided by DRM and/or AES-128 encryption, including:

  • Limiting playback to a particular user agent
  • Limiting the number of IP addresses
  • limiting the total users

For a comprehensive set of restrictions, you can configure them using the Playback Rights API. In this case, you would associate the playback_rights_id with a video. For details, see the Asset-level restrictions section of the Overview: Brightcove Playback Restrictions document.

For runtime restrictions, you can specify the JSON Web Token (JWT) claims. These restrictions include stream concurrency and device limits. For details, see the Runtime restrictions section of the Overview: Brightcove Playback Restrictions document.

With live streams, you can also override the DRM CRT for a user. For details, see the License Keys Protection section of the Overview: Brightcove Playback Restrictions document.

No matter which mode you choose, the job request must include a videocloud.video attribute so that a Video Cloud video is created and linked to the live job. The playback_rights_id attribute can be updated on the Video Cloud video to change the playback restrictions via the CMS API.

You will also need to create a JSON Web Token (JWT) with the appropriate claims. The JWT will need to be included in any license server requests. If you are implementing your own player, you will need to pass this value in either a BCOV-Auth header or bcov_auth query parameter (in addition to the DRM token).

Create a Live job using Studio

You can create a live job that utilizes playback restrictions in Video Cloud Studio.

  1. Look over the details for creating live streams in the Create a Live Stream Using the Brightcove Live API document.
  2. In Studio, when you create your live event, expand the Advanced Options section.

  3. For Content Encryption, select either:

    • AES-128
    • Digital Rights Management (DRM)
    AES-128 encryption
    AES-128 encryption

    For details, see the Configuring advanced options section of the Creating and Managing Live Events using the Live Module document.

  4. To extend playback protections, check the box to Enable Playback Restrictions.

    Enable Playback Restrictions
    Enable Playback Restrictions

    The job request must include a videocloud.video attribute so that a Video Cloud video is created and linked to the live job. The playback_rights_id attribute can be updated on the Video Cloud video to change the playback restrictions via the CMS API.

Create a Live job using the Live API

You can create a live job that utilizes playback restrictions using the Brightcove Live API.

  1. Look over the details for creating live streams in the Creating and Managing Live Events using the Live Module document.
  2. Review the new fields used to add Playback Restrictions to a Live job:

    • drm object:

      require_playback_token (boolean)
      Playback auth JWT will be required when requesting license.
      check_playback_rights (boolean)
      Playback auth JWT will be required when requesting license. Uses playback rights id associated with video or JWT to enforce restrictions.
    • videocloud.video object:

      playback_rights_id (string)
      Associates specified Playback Restrictions with a video.
  3. Create a live job using the Brightcove Live API.

    Sample request and response

    Below is a sample Live API request body for creating a Live job with Playback Restrictions.

    Sample request body

    {
      "live_stream": true,
      "region": "us-west-2",
      "reconnect_time": 300,
      "ad_insertion": false,
      "static": false,
      "drm": {
        "modes":["all"],
        "require_playback_token": true,
        "check_playback_rights": true
      },
      "encryption": {
        "check_playback_rights": true,
        "method": "aes-128",
        "type": "internal",
        "key": "24432646294A404E635266556A586E32"
      },
      "live_dvr_sliding_window_duration": 300,
      "videocloud": {
        "live_to_vod": true,
        "video": {
            "name": "Test EPA",
            "description": "",
            "long_description": "",
            "tags": [],
            "reference_id": "",
            "link": {
                "url": "",
                "text": ""
            },
            "custom_fields": {}
          }
      },  
      "outputs": [{
          "label": "hls720p",
          "live_stream": true,
          "height": 720,
          "video_bitrate": 2000,
          "segment_seconds": 6,
          "keyframe_interval": 60
      },
      {
          "label": "hls480p",
          "live_stream": true,
          "height": 480,
          "video_bitrate": 1000,
          "segment_seconds": 6,
          "keyframe_interval": 60
      }
    }

    Sample response

    The highlighed line contains the video id that you need to add the playback_rights_id

    {
      "id": "f47487cf81f84764b280fbfaefed524a",
      "outputs": [
          {
              "id": "0-f47487cf81f84764b280fbfaefed524a",
              "label": "hls720p"
          },
          {
              "id": "1-f47487cf81f84764b280fbfaefed524a",
              "label": "hls480p"
          },
          {
              "id": "2-f47487cf81f84764b280fbfaefed524a",
              "playlist_type": "defaultS3",
              "type": "playlist",
              "drm": {
                  "token": "eyJh...axy8",
                  "modes": [
                      {
                          "type": "fairplay",
                          "key_system": "com.apple.fps.1_0",
                          "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/fp?token=eyJh...axy8",
                          "certificate_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/cert/fp?token=eyJh...axy8",
                          "filename": "playlist_fp.m3u8",
                          "dvr_filename": "playlist_fp_dvr.m3u8",
                          "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_fp.m3u8",
                          "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_fp_dvr.m3u8",
                          "playback_added_cdns": []
                      },
                      {
                          "type": "widevine",
                          "key_system": "com.widevine.alpha",
                          "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/wv?token=eyJh...axy8",
                          "filename": "playlist_wv.m3u8",
                          "dvr_filename": "playlist_wv_dvr.m3u8",
                          "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_wv.m3u8",
                          "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_wv_dvr.m3u8",
                          "playback_added_cdns": []
                      },
                      {
                          "type": "playready",
                          "key_system": "com.microsoft.playready",
                          "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/pr?token=eyJh...axy8",
                          "filename": "playlist.mpd",
                          "dvr_filename": "playlist_dvr.mpd",
                          "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist.mpd",
                          "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_dvr.mpd",
                          "playback_added_cdns": []
                      }
                  ],
                  "token_expires_in": 43200,
                  "require_playback_token": true,
                  "check_playback_rights": true
              }
          }
      ],
      "stream_url": "rtmp://ep8-usw2.a-live.io:1935/f47487cf81f84764b280fbfaefed524a",
      "stream_name": "alive",
      "static": false,
      "event_length": 93600,
      "job_videocloud_asset_id": "70701312966202",
      "encryption": {},
      "drm_enabled": true,
      "drm": {
        "token": "eyJh...axy8",
        "modes": [
          {
            "type": "fairplay",
            "key_system": "com.apple.fps.1_0",
            "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/fp?token=eyJhb...axy8",
            "certificate_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/cert/fp?token=eyJhb...axy8",
            "filename": "playlist_fp.m3u8",
            "dvr_filename": "playlist_fp_dvr.m3u8",
            "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_fp.m3u8",
            "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_fp_dvr.m3u8",
            "playback_added_cdns": []
          },
          {
            "type": "widevine",
            "key_system": "com.widevine.alpha",
            "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/wv?token=eyJhb...axy8",
            "filename": "playlist_wv.m3u8",
            "dvr_filename": "playlist_wv_dvr.m3u8",
            "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_wv.m3u8",
            "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_wv_dvr.m3u8",
            "playback_added_cdns": []
          },
          {
            "type": "playready",
            "key_system": "com.microsoft.playready",
            "license_url": "https://license-proxy-qa.alive.us-west-2.qa.deploys.brightcove.com/lic/pr?token=eyJh...axy8",
            "filename": "playlist.mpd",
            "dvr_filename": "playlist_dvr.mpd",
            "playback_url": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist.mpd",
            "playback_url_dvr": "https://playback-qa.a-live.io/f47487cf81f84764b280fbfaefed524a/us-west-2/NA/playlist_dvr.mpd",
            "playback_added_cdns": []
          }
        ],
        "token_expires_in": 43200,
        "require_playback_token": true,
        "check_playback_rights": true
      }
    }

Add restrictions to the live job

After you create the live stream, you can add Playback Restrictions the video created for the live job using the CMS API.

CMS API request

To add the playback rights id to the video, send an Update video request to the CMS API with the following request body:

{
	"playback_rights_id": "your playback_rights_id"
}

Deliver the stream

If you are using the Brightcove web player or one of the Brightcove native player SDKs to deliver the live stream, the implementation for Playback Restrictions is the same as for VOD. See the following: