Skip to main content

API reference

This reference summarizes the public APIs used most often in @quickplay/player-react. It focuses on provider setup, both player components, and key configuration objects.

QuickplayPlatformProvider

QuickplayPlatformProvider initializes platform and content auth services and makes them available through context.

Primary props

PropTypeRequiredDescription
configUrlstringConditionallyRemote config URL. Use this or config.
configQuickplayPlatformConfigConditionallyManual platform configuration object.
headersRecord<string, string>NoRequest headers, such as X-Property-Id.
analyticsConfigAnalyticsConfigNoOptional analytics session configuration.
quickplayAccessTokenManagerQuickplayAccessTokenManagerNoCustom token manager override.
childrenReactNodeYesApp subtree that consumes platform context.

Note: Use either configUrl or config, but not both.

AnalyticsConfig

FieldTypeRequiredDescription
enabledbooleanYesEnable analytics tracking.
application.namestringYesApplication name reported to analytics.
application.versionstringYesApplication version string.
application.buildstringYesApplication build identifier.
device.platformTypePlatformTypeYesPlatform type: WEB, IOS, ANDROID, and so on.
device.customDeviceManufacturerstringNoOverride device manufacturer.
device.customDeviceNamestringNoOverride device name.
user.idstringYesUser identifier reported to analytics.

QuickplayPlayer

QuickplayPlayer is the platform-integrated player and must be rendered inside QuickplayPlatformProvider.

Basic props

PropTypeRequiredDefaultDescription
sourcePlatformAssetYes-Asset reference for platform authorization.
controlsbooleanNotrueToggles media controls.
autoPlaybooleanNotrueStarts playback when ready.
titlestringNo-Top chrome title text.
subtitlestringNo-Top chrome subtitle text.
classNamestringNo''CSS class for player container.
configQuickplayPlayerConfigNo-Advanced playback and runtime settings.
controlsOptionsMediaChromeControlsOptionsNo-Optional control toggles and error overlay labels.

Event callbacks

PropTypeDescription
onPlayerReady(player: Player) => voidFires when player instance is ready.
onError(error: Error) => voidFires on auth or playback failure.
onStateChange(state: PLAYBACK_STATES) => voidFires on playback state changes.
onProgress(progress: unknown) => voidFires during playback progress updates.

PlatformAsset

PlatformAsset is the source type for QuickplayPlayer. The following fields are most commonly used:

FieldTypeDescription
mediaIDstringPlatform content identifier.
catalogTypestringContent catalog type: clip, episode, movie, or channel.
mediaTypestringStream format: hls or dash.
drmSchemestringDRM type: none, widevine, or fairplay.
consumptionTypestringConsumption mode: vod or live.

ContentPlayer

ContentPlayer is platform-agnostic and plays from resolved content metadata. It does not require QuickplayPlatformProvider.

ContentSource

ContentSource is the minimum source contract for ContentPlayer.

interface ContentSource {
contentUrl: string;
drmLicenseUrl: string;
mediaType: MediaType;
drmScheme: DrmScheme;
fpCertificateUrl?: string;
}

Additional ContentPlayer props

ContentPlayer supports the same UI and callback props as QuickplayPlayer plus these fields:

PropTypeDescription
sourceContentSourceResolved content data.
isLoadingbooleanExternal loading state input.
errorError | nullExternal error to surface in UI.
imageResizerEndpointstringThumbnail image resizer endpoint.
configContentPlayerConfigPlayback/runtime options for direct mode.

Key config objects

These config fields are frequently used in both player components.

QuickplayPlayerConfig

FieldDescription
imageResizerEndpointOverride the platform-level image resizer URL for thumbnail sprites.
logLevelLog verbosity: LoggerLevel.OFF, ERROR, WARN, INFO, DEBUG, or VERBOSE.
headersCustom headers attached to all platform API requests.
playerLibrarySupply a custom or pinned Shaka Player build instead of the bundled version.
renewLicenseCallback invoked when the DRM license is approaching expiry. Quickplay only.
disableHeartbeatDisable the heartbeat keep-alive. For development and testing only.
playbackOptionsFine-tune buffering, retry, and autoplay behavior (see below).
janusOptionsJanus WebRTC gateway configuration (server URL, ICE servers, stream ID).

ContentPlayerConfig

ContentPlayerConfig accepts the same fields as QuickplayPlayerConfig except renewLicense and disableHeartbeat, which are Quickplay-specific.

FieldDescription
imageResizerEndpointImage resizer URL for thumbnail sprites.
logLevelLog verbosity level.
headersCustom headers for requests.
playerLibraryCustom Shaka Player build.
playbackOptionsBuffering, retry, and autoplay settings.
janusOptionsJanus WebRTC gateway configuration.

MediaChromeControlsOptions

FieldDefaultDescription
showPipButtonfalseShow the Picture-in-Picture button.
showCastButtonfalseShow the Chromecast button.
showCaptionsButtonfalseShow an inline captions toggle.
showErrorOverlaytrueShow the error overlay on playback failure.
errorTitleError overlay heading text.
errorMessageError overlay body text.
errorPrimaryLabelPrimary action button label.
errorSecondaryLabelSecondary action button label.
onErrorPrimaryCallback for the primary error action.
onErrorSecondaryCallback for the secondary error action.

Playback states

The player emits state changes via the onStateChange callback. These are the possible values of PLAYBACK_STATES:

StateDescription
IDLEPlayer initialized, no content loaded.
LOADINGContent is loading.
PLAYINGContent is actively playing.
PAUSEDPlayback is paused.
BUFFERINGPlayer is waiting for the buffer to fill.
ENDEDPlayback completed.
ERRORA playback error occurred.

Exported runtime values

The package exports runtime constants and enums you can use in app code.

  • version
  • LoggerLevel
  • PlayerType
  • PlatformType

Full TypeScript type definitions ship with the package. Import individual types using import type:

import type {
QuickplayPlayerProps,
QuickplayPlayerConfig,
ContentPlayerProps,
ContentPlayerConfig,
ContentSource,
QuickplayAccessTokenManager,
Player,
PLAYBACK_STATES,
} from '@quickplay/player-react';

Next steps

Use this page with the scenario guides when implementing full features.