Content entitlements
Content entitlements gate premium content per viewer. The SDK carries the viewer's identity to the content service, resolves each item against it, and reports the service's decision. Entitlement is enforced server-side: the SDK never decides who is entitled, it relays the decision. Content entitlements are enabled per account by WSC Sports; until they are enabled for your app, the SDK does not check content and onContentRestricted is not called. Stream tokenization, also enabled per account, turns on the same check for videos only.
The flow
- Viewer token. The host supplies a token that identifies the viewer, either on
initor later throughsetExternalUserToken. The SDK passes it to the content service unchanged and holds it in memory only, so it is supplied again on every launch. Until a token is set, any item that arrives without a playback URL is refused locally with the missing-token reason (externalUserTokenMissingon iOS,EXTERNAL_USER_TOKEN_MISSINGon Android), and no request is sent. The SDK checks the item again once a token is set. On iOS the item is not held as refused in the meantime. - Resolve. When an item is about to play, the SDK asks the service to resolve it under the current token. An entitled item returns a playback URL and plays. A refused item returns a reason. A stream that has not started yet is checked too, so
onContentRestrictedcan fire before the stream goes live. - Restriction event. The SDK raises
onContentRestrictedwith the reason and which item was refused. The host returns a value saying whether it took care of the refusal, for example with its own paywall; the SDK currently treats both values the same way (see below).
What happens to a refused item
Playback of a refused item does not start, whatever onContentRestricted returns. The SDK holds the item on screen (it does not skip it) and removes the controls and indicators that would promise playback.
- iOS: the SDK currently applies the treatment above whatever is returned. Return
handledByAppwhen the host presents its own response, such as a paywall. ReturningsdkShouldHandle, or leaving the handler unset, leaves the refusal to the SDK, which does not currently present its own restriction UI. No ads run on a refused item. - Android: the return value is reserved for a later version, in which it will choose between the SDK's own presentation of the refused item (
SDK_SHOULD_HANDLE) and the host's (HANDLED_BY_APP). For now the SDK applies the treatment above whatever is returned.
Token changes mid-session
Changing the token cancels any resolve still in flight. If the item on screen has no playback URL yet, including one that was refused, the SDK checks it again under the new token, so playback can start, or onContentRestricted fire again, without reopening the player. An item that is already playing is not interrupted. BlazeFetchedContentPolicy controls whether content already fetched is kept or evicted and refetched.
Content with no playable URL
When the entitlement feature is off, an item that arrives without a playable URL is omitted rather than shown as a dead item. Videos and Moments drop the individual item; a Story drops as a whole if any one of its pages has no playable URL, since a Story is played as a single unit. When the feature is on, such an item is kept and resolved as described above, since its URL was removed on purpose.
Per-platform reference
- iOS:
setExternalUserTokenin Methods and parameters;onContentRestricted, the reasons, and the related types in BlazePlayerSourceDelegate. - Android:
setExternalUserTokenin Methods and parameters;onContentRestricted, the reasons, and the related types in BlazePlayerSourceDelegate.
Related
Updated 11 days ago
