Skip to main content

Brightcove Integration

The rn-qp-nxg-player SDK provides comprehensive support for Brightcove playback with Server-Side Ad Insertion (SSAI). This guide covers setup, configuration, and implementation details for integrating Brightcove content.

Overview

Brightcove integration enables:

  • Server-Side Ad Insertion (SSAI) for monetization
  • Brightcove Video Cloud analytics via Data Collection API v2
  • Ad playback policies and controls
  • DRM content protection
  • Thumbnail previews with keyframe scrubbing

Required Configuration

To create a Brightcove player, the following properties are required:

PropertyTypeRequiredDescription
mediaURLStringYesContent URL for playback
vmapURLStringYesVMAP URL for Server-Side Ad Insertion
contentTypeStringYesContent type: 'VOD' or 'LIVE'
mediaTypeStringYesMedia type: 'HLS'

Basic Setup

To create and play Brightcove content:

import { createPlayer, PlayerConfig } from '@quickplay/rn-qp-nxg-player';

const playerConfig: PlayerConfig = {
mediaURL: '<Content URL for playback>',
useCustomPlayerControls: '<true/ false>',
vmapURL: '<VMAP URL returned by the Brightcove SSAI session>',
contentType: '<VOD or LIVE>',
mediaType: 'HLS',
};

const player = await createPlayer(playerConfig);
await player.play();

DRM Configuration

For protected content, configure DRM license URLs and types:

const playerConfig: PlayerConfig = {
mediaURL: '<Content URL for playback>',
vmapURL: '<VMAP URL returned by the Brightcove SSAI session>',
mediaType: 'HLS',
drmLicenseURL: '<license server URL provided by your DRM vendor>',
drmType: '<DRM scheme: WIDEVINE | FAIRPLAY | PLAYREADY | NONE>',
drmLicenseRefreshToken: '<token used to refresh the DRM license before expiry>',
};

Supported DRM Schemes:

  • WIDEVINE — Android
  • FAIRPLAY — iOS
  • PLAYREADY — Windows/Xbox
  • NONE — No DRM

PAL Configuration

Configure Google PAL (Privacy and Audience Management) for ad targeting and measurement:

const playerConfig: PlayerConfig = {
mediaURL: '<Content URL for playback>',
vmapURL: '<VMAP URL returned by the Brightcove SSAI session>',
mediaType: 'HLS',
palConfiguration: {
descriptionURL: '<URL of the page where the video is embedded>',
omidPartnerName: '<name of the OMID measurement partner>',
omidPartnerVersion: '<version of the OMID partner SDK>',
omidVersion: '<OMID API version in use>',
playerType: '<type identifier of the player (e.g., "rn-qp-nxg-player")>',
playerVersion: '<version of the player SDK>',
ppid: '<publisher-provided user identifier for ad targeting>',
videoPlayerHeight: 480,
videoPlayerWidth: 720,
},
};

Subtitle and Audio Configuration

Configure preferred subtitles and audio tracks (Android only):

const playerConfig: PlayerConfig = {
mediaURL: '<Content URL for playback>',
vmapURL: '<VMAP URL returned by the Brightcove SSAI session>',
mediaType: 'HLS',
preferredSubtitleLanguage: 'en',
preferredAudioLanguage: { language: 'en', region: 'US' },
preferredMimeTypes: ['video/mp4', 'audio/aac'],
};

Thumbnail Preview

Retrieve thumbnail URLs for keyframe-based scrubbing:

const getThumbnailUrl = async (currentPosition: number): Promise<string | undefined> => {
return await player.getThumbnailUrl(currentPosition);
};

Brightcove Data Collection API v2

Enable analytics collection for Brightcove Video Cloud. The rn-qpnxg-player package now supports analytics reporting to Brightcove's Data Collection API v2.This enables tracking of playback events, user engagement, and optional QoE metrics. Below are the parameters reported to the data collection API, along with details on which values are auto-collected and which require explicit configuration. Apps can also override these properties from their default or auto-collected values.

Data Collection Configuration

Config Parameters

ParameterTypeRequiredDefaultDescription
accountStringYesN/ABrightcove Video Cloud account ID.
videoStringYes*N/AVideo ID. Required for most video-related events.
eventStringNoN/AEvent type (e.g., player_load, video_view, etc.).
sessionStringNoAuto-gen (if not passed by you)Unique session identifier. Should remain constant per playback session.
videoName (video_name)StringNonullHuman-readable video name.
videoDuration (video_duration)NumberNo (VOD)nullRequired for VOD events. Must NOT be sent for Live streams.
engagementEventIntervalIntNo10000Interval (ms) between engagement events. Recommended: 5000–20000 (events >20s ignored).
user (user)StringNoDerived (IP + UA)Unique user identifier (hashed internally using SHA-256).
deviceType (device_type)StringNoAuto-detectedOverride device type (mobile, tv, desktop, etc.). Only used if paired with device_os.
deviceOs (device_os)StringNoAuto-detectedOverride OS (android, ios, etc.).
deviceOsVersion (device_os_version)StringNoAuto-detectedOS version.
deviceManufacturerStringNoAuto-detectedNot officially required; typically inferred via User-Agent.
deviceModelStringNoAuto-detectedNot officially required; typically inferred via User-Agent.
countryStringNoAuto-detectedISO-3166 alpha-2 country code. Override only if IP unreliable.
countryName (country_name)StringNoAuto-detectedHuman-readable country name.
regionStringNoAuto-detectedISO-3166 region code.
regionName (region_name)StringNoAuto-detectedHuman-readable region name.
cityStringNoAuto-detectedCity name.
dmaStringNonullDMA code (US only).
destinationStringNonullCurrent page/app URI where playback occurs.
sourceStringNonullReferrer URI (traffic source).
player (playerId)StringNoAuto-detectedPlayer ID.
playerName (player_name)StringNoAuto-detectedPlayer name.
applicationStringNonullCustom application identifier.
timeNumberNoAuto-generatedEvent timestamp (epoch ms).
debugLoggingBooleanNofalseSDK-side only (not sent to Brightcove).
includeQoEMetricsBooleanNofalseSDK-side flag to include QoE fields in engagement events.

Example Implementation

import { createPlayer, PlayerConfig } from '@quickplay/rn-qp-nxg-player';

const playerConfig: PlayerConfig = {
mediaURL: config.mediaUrl,
vmapURL: config.vmapUrl,
useCustomPlayerControls: false,
contentType: config.contentType,
mediaType: 'HLS',
fastForwardRule: 'TRICK_FW_PLAY_LAST',
rewindRule: 'TRICK_RW_SKIP_ALL',
// add the remaining required policies
dataCollectionConfig: {
accountId: config.accountId,
videoId: config.videoId,
},
};

const player = await createPlayer(playerConfig);
await player.play(); // Explicitly call play for Android.

For player lifecycle management (stop, dispose, event listeners), see Core Player Features.