Multi-DRM
Bring your DRM vendor’s license URLs and OGPlayer handles the rest — key
exchange, renewals, error mapping to the stable 4000-series codes, and the
DrmKeysLoaded analytics event on success.
| Platform | Systems |
|---|---|
| Android | Widevine (default), PlayReady, ClearKey |
| iOS | FairPlay |
| Web | Widevine, PlayReady and FairPlay — the SDK engages whichever the browser supports |
OGMediaItem.Builder("https://example.com/protected.mpd") .setDrm( DrmConfig.Builder("https://drm.example.com/widevine") .addHeader("x-custom", "value") .build(), ) .build()var item = OGMediaItem(urlString: "https://example.com/protected.m3u8")!item.drm = FairPlayConfig( certificateURLString: "https://drm.example.com/fairplay.cer", licenseServerURLString: "https://drm.example.com/fairplay")player.load({ url: "https://example.com/protected.m3u8", drm: { widevine: { licenseUrl: "https://drm.example.com/widevine" }, playready: { licenseUrl: "https://drm.example.com/playready" }, fairplay: { licenseUrl: "https://drm.example.com/fairplay", certificateUrl: "https://drm.example.com/fairplay.cer" }, },});Failures are never mysterious: every DRM problem maps to a stable code — 4000 license failed, 4001+status HTTP, 4002 token fetch, 4003 provisioning, 4004 session expired, 4005 unsupported — see error codes. Android additionally retries silently (max 2 attempts / 60 s) before surfacing anything.
For expiring tokens, use a token provider instead of static headers.