Using NextGen Live with the Native SDKs

In this topic, you will learn how to play NextGen Live streams using the Brightcove Native SDKs.

Overview

NextGen Live is Brightcove's next-generation live streaming platform that offers enhanced features and capabilities. When working with NextGen Live streams, you need to pass a live playback token with your video request to enable various advanced features.

The live playback token is required for NextGen Live streams to access features such as:

  • Server-Side Ad Insertion (SSAI)
  • DVR (Digital Video Recording) playback
  • Low-latency playback
  • BYO CDN (Bring Your Own Content Delivery Network)
  • Custom stream configurations

SDK compatibility

NextGen Live streams are compatible with recent versions of the Brightcove Native SDKs:

Android SDK

  • Recommended: Android SDK 10.2.4 or later includes full support for NextGen Live features and fixes for DRM-related issues
  • Backward compatibility: Older Android SDK versions can also work with NextGen Live using the legacy adConfigId parameter where we would use livePlaybackToken instead

iOS SDK

  • Recommended: Recent versions of the iOS SDK support NextGen Live streams
  • Backward compatibility: Older iOS SDK versions can also work with NextGen Live using the legacy adConfigId parameter where we would use livePlaybackToken instead

Steps

To play a NextGen Live stream with the Native SDKs, follow these steps:

  1. Create a NextGen Live event
  2. Get the live playback token
  3. Build your app:

Create a NextGen Live event

To create a NextGen Live event using the Live module in Video Cloud Studio, follow these steps:

  1. Log in to Video Cloud Studio.
  2. In the primary navigation, click Live.
  3. Click Create Channel.
  4. Enter your Channel Name and configure your streaming settings as needed.
  5. Configure any advanced features you need for your stream:

    • SSAI: In the Advanced Options section, enable Server-Side Ad Insertion (SSAI) and select your ad configuration
    • DVR: Configure DVR settings if you want viewers to be able to seek backwards in the live stream
    • Low-latency: Enable low-latency streaming if required
  6. When you are finished configuring your NextGen Live event, click Create Channel.

Get the live playback token

The live playback token is a required parameter for playing NextGen Live streams with advanced features. You can obtain this token from the player embed code in the Live module.

To get the live playback token, follow these steps:

  1. In Video Cloud Studio, return to the Live module.
  2. On the top right corner, select Publish and Embed.
  3. If you're using DVR, SSAI or other advanced features, configure them in the Live Player Options section. For example, for SSAI, expand the Select Ad Configuration option and select your ad configuration.

  4. Copy the Standard Embed Code to your clipboard.

    Embed code
    Embed code
  5. From the embed code, copy the VideoId parameter value. You will use this value in a later step. It should look similar to this:

    6379789752112
  6. From the embed code, copy the livePlaybackToken parameter value. This is your live playback token. It should look similar to this:

    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtbiI6InBsYXlsaXN0Iiwic3NhaSI6dHJ1ZSwiYWNpZCI6IjRmMWFjYWQyLTE2MDMtNDg1Ni1hZmFjLThhYWM3NjM1YzEyYyIsImlzcyI6ImJsaXZlLXBsYXliYWNrLW1hbmFnZW1lbnQtYXBpIiwic3ViIjoicGxheWJhY2t0b2tlbiIsImF1ZCI6WyI2NDE1NTE4NjI3MDAxIl0sImp0aSI6IjYzNzk3ODk3NTIxMTIifQ.zdWC1VA5nm3CKNqNclYYNi6aSL3FbjbeHHmb5oHoziQ
  7. You will also need the Account Id and Policy Key for your account.

Android implementation

To play a NextGen Live stream with the Android SDK, you'll pass the live playback token with your video request.

Using the livePlaybackToken parameter (Recommended)

For Android SDK 10.2.4 and later, use the livePlaybackToken parameter for better compatibility and future-proofing:

  1. Use the Basic SSAI Sample App as a starting point for your code.
  2. In the res/values/strings.xml file, replace the following with your own values:
  3. In your activity file (e.g., MainActivity.java), define the live playback token value:

    private final String LIVE_PLAYBACK_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtbiI6InBsYXlsaXN0Iiwic3NhaSI6dHJ1ZSwiYWNpZCI6IjRmMWFjYWQyLTE2MDMtNDg1Ni1hZmFjLThhYWM3NjM1YzEyYyIsImlzcyI6ImJsaXZlLXBsYXliYWNrLW1hbmFnZW1lbnQtYXBpIiwic3ViIjoicGxheWJhY2t0b2tlbiIsImF1ZCI6WyI2NDE1NTE4NjI3MDAxIl0sImp0aSI6IjYzNzk3ODk3NTIxMTIifQ.zdWC1VA5nm3CKNqNclYYNi6aSL3FbjbeHHmb5oHoziQ";
  4. Add the livePlaybackToken to the HTTP request as a query parameter:

    HttpRequestConfig httpRequestConfig = new HttpRequestConfig.Builder()
      .addQueryParameter("livePlaybackToken", LIVE_PLAYBACK_TOKEN)
      .build();
    
  5. Make the catalog call to the Playback API with your live stream video id and the updated HTTP request:

    catalog.findVideoByID(getString(R.string.video_id), httpRequestConfig, new VideoListener() {
       @Override
       public void onVideo(Video video) {
           plugin.processVideo(video);
       }
     });
    
  6. Your app is ready to play the NextGen Live stream.

Using the adConfigId parameter (Backward Compatibility)

For backward compatibility with older SDK versions, you can also use the adConfigId parameter:

HttpRequestConfig httpRequestConfig = new HttpRequestConfig.Builder()
  .addQueryParameter("adConfigId", LIVE_PLAYBACK_TOKEN)
  .build();

iOS implementation

To play a NextGen Live stream with the iOS SDK, you'll pass the live playback token with your video request.

Using the livePlaybackToken parameter (Recommended)

For recent versions of the iOS SDK, use the livePlaybackToken parameter:

  1. Use the Basic SSAI Sample App as a starting point for your code.
  2. In the ViewController.swift file, replace the following with your own values:
  3. In the ViewController.swift file, define the live playback token:

    let LivePlaybackToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtbiI6InBsYXlsaXN0Iiwic3NhaSI6dHJ1ZSwiYWNpZCI6IjRmMWFjYWQyLTE2MDMtNDg1Ni1hZmFjLThhYWM3NjM1YzEyYyIsImlzcyI6ImJsaXZlLXBsYXliYWNrLW1hbmFnZW1lbnQtYXBpIiwic3ViIjoicGxheWJhY2t0b2tlbiIsImF1ZCI6WyI2NDE1NTE4NjI3MDAxIl0sImp0aSI6IjYzNzk3ODk3NTIxMTIifQ.zdWC1VA5nm3CKNqNclYYNi6aSL3FbjbeHHmb5oHoziQ";
  4. Add the live playback token to the HTTP request as a query parameter:

    let queryParameters = ["livePlaybackToken": LivePlaybackToken]
    
  5. Make the catalog call to the Playback API with your live stream video id and the updated HTTP request:

    playbackService.findVideo(withConfiguration: configuration, parameters: queryParameters, completion: { [weak self] (video: BCOVVideo?, jsonResponse: [AnyHashable: Any]?, error: Error?) -> Void in
    
       guard let _video = video else {
         print("ViewController Debug - Error retrieving video: \(error?.localizedDescription ?? "unknown error")")
         return
       }
    
       self?.playbackController?.setVideos([_video] as NSFastEnumeration)
    })
    
  6. Your app is ready to play the NextGen Live stream.

Using the adConfigId parameter (Backward Compatibility)

For backward compatibility with older SDK versions, you can also use the kBCOVPlaybackServiceParamaterKeyAdConfigId constant:

let queryParameters = [kBCOVPlaybackServiceParamaterKeyAdConfigId: LivePlaybackToken]

Migration from Live 1.0 to NextGen Live

When migrating from Live 1.0 to NextGen Live, consider the following:

Minimal code changes required

  • The implementation pattern remains the same as Live 1.0
  • You continue to pass the playback token as a query parameter
  • The token value is obtained from the same location (Live module embed code or API)
  • For backward compatibility, the adConfigId parameter continues to work

Recommended updates

  • Android: Update to SDK version 10.2.4 or later for optimal compatibility
  • iOS: Update to the latest SDK version
  • Update your code to use livePlaybackToken instead of adConfigId for clarity

Testing

Before deploying to production, test your app with NextGen Live streams to ensure:

  • Basic playback works correctly
  • DRM-protected streams play properly (if using DRM)
  • Captions display correctly (if using captions)
  • Any advanced features (DVR, SSAI, etc.) function as expected