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
| Prop | Type | Required | Description |
|---|---|---|---|
configUrl | string | Conditionally | Remote config URL. Use this or config. |
config | QuickplayPlatformConfig | Conditionally | Manual platform configuration object. |
headers | Record<string, string> | No | Request headers, such as X-Property-Id. |
analyticsConfig | AnalyticsConfig | No | Optional analytics session configuration. |
quickplayAccessTokenManager | QuickplayAccessTokenManager | No | Custom token manager override. |
children | ReactNode | Yes | App subtree that consumes platform context. |
Note: Use either
configUrlorconfig, but not both.
AnalyticsConfig
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable analytics tracking. |
application.name | string | Yes | Application name reported to analytics. |
application.version | string | Yes | Application version string. |
application.build | string | Yes | Application build identifier. |
device.platformType | PlatformType | Yes | Platform type: WEB, IOS, ANDROID, and so on. |
device.customDeviceManufacturer | string | No | Override device manufacturer. |
device.customDeviceName | string | No | Override device name. |
user.id | string | Yes | User identifier reported to analytics. |
QuickplayPlayer
QuickplayPlayer is the platform-integrated player and must be rendered inside
QuickplayPlatformProvider.
Basic props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
source | PlatformAsset | Yes | - | Asset reference for platform authorization. |
controls | boolean | No | true | Toggles media controls. |
autoPlay | boolean | No | true | Starts playback when ready. |
title | string | No | - | Top chrome title text. |
subtitle | string | No | - | Top chrome subtitle text. |
className | string | No | '' | CSS class for player container. |
config | QuickplayPlayerConfig | No | - | Advanced playback and runtime settings. |
controlsOptions | MediaChromeControlsOptions | No | - | Optional control toggles and error overlay labels. |
Event callbacks
| Prop | Type | Description |
|---|---|---|
onPlayerReady | (player: Player) => void | Fires when player instance is ready. |
onError | (error: Error) => void | Fires on auth or playback failure. |
onStateChange | (state: PLAYBACK_STATES) => void | Fires on playback state changes. |
onProgress | (progress: unknown) => void | Fires during playback progress updates. |
PlatformAsset
PlatformAsset is the source type for QuickplayPlayer. The following
fields are most commonly used:
| Field | Type | Description |
|---|---|---|
mediaID | string | Platform content identifier. |
catalogType | string | Content catalog type: clip, episode, movie, or channel. |
mediaType | string | Stream format: hls or dash. |
drmScheme | string | DRM type: none, widevine, or fairplay. |
consumptionType | string | Consumption 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:
| Prop | Type | Description |
|---|---|---|
source | ContentSource | Resolved content data. |
isLoading | boolean | External loading state input. |
error | Error | null | External error to surface in UI. |
imageResizerEndpoint | string | Thumbnail image resizer endpoint. |
config | ContentPlayerConfig | Playback/runtime options for direct mode. |
Key config objects
These config fields are frequently used in both player components.
QuickplayPlayerConfig
| Field | Description |
|---|---|
imageResizerEndpoint | Override the platform-level image resizer URL for thumbnail sprites. |
logLevel | Log verbosity: LoggerLevel.OFF, ERROR, WARN, INFO, DEBUG, or VERBOSE. |
headers | Custom headers attached to all platform API requests. |
playerLibrary | Supply a custom or pinned Shaka Player build instead of the bundled version. |
renewLicense | Callback invoked when the DRM license is approaching expiry. Quickplay only. |
disableHeartbeat | Disable the heartbeat keep-alive. For development and testing only. |
playbackOptions | Fine-tune buffering, retry, and autoplay behavior (see below). |
janusOptions | Janus 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.
| Field | Description |
|---|---|
imageResizerEndpoint | Image resizer URL for thumbnail sprites. |
logLevel | Log verbosity level. |
headers | Custom headers for requests. |
playerLibrary | Custom Shaka Player build. |
playbackOptions | Buffering, retry, and autoplay settings. |
janusOptions | Janus WebRTC gateway configuration. |
MediaChromeControlsOptions
| Field | Default | Description |
|---|---|---|
showPipButton | false | Show the Picture-in-Picture button. |
showCastButton | false | Show the Chromecast button. |
showCaptionsButton | false | Show an inline captions toggle. |
showErrorOverlay | true | Show the error overlay on playback failure. |
errorTitle | — | Error overlay heading text. |
errorMessage | — | Error overlay body text. |
errorPrimaryLabel | — | Primary action button label. |
errorSecondaryLabel | — | Secondary action button label. |
onErrorPrimary | — | Callback for the primary error action. |
onErrorSecondary | — | Callback for the secondary error action. |
Playback states
The player emits state changes via the onStateChange callback. These are the
possible values of PLAYBACK_STATES:
| State | Description |
|---|---|
IDLE | Player initialized, no content loaded. |
LOADING | Content is loading. |
PLAYING | Content is actively playing. |
PAUSED | Playback is paused. |
BUFFERING | Player is waiting for the buffer to fill. |
ENDED | Playback completed. |
ERROR | A playback error occurred. |
Exported runtime values
The package exports runtime constants and enums you can use in app code.
versionLoggerLevelPlayerTypePlatformType
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.
- Start integration in Integration guide
- Configure auth in Platform and authentication
- Tune behavior in Advanced usage