Day 2 · 18 min read

SDK Use Cases

Live, VOD, offline, multi-DRM, ad-supported.

The catalogue of use cases

Day 2 lectures will run through specific use cases the SDK is designed for. The set you'll see comes down to:

VOD streaming

Simplest case. The application authenticates the user, the licence service hands out an in-memory licence with a duration matching expected session length plus a margin. No persistence, no renewal unless sessions are exceptionally long.

Practical configuration: license_duration_seconds ≈ 6 hours covers any realistic single-session viewing. Keep the licence as small as possible — every byte travels over the wire.

Live

Live streams introduce two things VOD doesn't have:

  1. Continuous playback — a single session may run for hours.
  2. Key rotation — the packager rotates content keys every N seconds.

To handle these, the CDM emits renewal requests as keys approach expiry. The application forwards them to the same licence URL like any other request. The server should accept renewal requests on existing sessions and return a fresh licence covering the upcoming KIDs.

Offline / download-to-go

The download flow:

  1. User taps "download".
  2. Player downloads manifest + segments.
  3. CDM (via the application) requests a KEY_TYPE_OFFLINE licence.
  4. Server returns a persistent licence with can_persist=true and playback_duration_seconds set to the rental window.
  5. CDM stores the licence; player saves the keysetId locally.

At replay time, the player opens a session and calls restoreKeys(keysetId). No network is required.

Studio policies cap which devices may be offered offline. Most studios approve offline only on L1 devices.

Multi-DRM

The same encrypted file (cbcs scheme typically) carries PSSH boxes for each DRM. The player picks the DRM the device supports:

  • Chrome / Android → Widevine.
  • Edge / Xbox → PlayReady.
  • Safari / iOS → FairPlay.

Each DRM has its own licence service (or a multi-DRM SaaS proxies all three). The integrator's licence URL is therefore typically per-DRM:

https://license.example.com/widevine
https://license.example.com/playready
https://license.example.com/fairplay

Ad-supported playback

Two options:

  1. Same encryption across content + ads — simplest, but ads must be encrypted with the same KIDs.
  2. Encrypted content, unencrypted ad breaks — common in practice. The DRM session must persist across the ad break (setUseDrmSessionsForClearPeriods on ExoPlayer) so it doesn't tear down and re-handshake.

Subscription with concurrent-stream limits

Widevine policy alone doesn't enforce "maximum 3 concurrent streams." That's an application concern: when the licence service issues a new licence, it checks how many active sessions the user has and refuses if they're at the limit. The CDM and policy don't know about other devices.

Exam tip

Concurrency limits are enforced server-side by the integrator, not by Widevine policy. Be ready to identify that distinction.

No questions yet for use-cases. Add some in content/questions/use-cases.json.