Enable leases
How it works
- When
player.load()is called, the player requests a lease from the lease endpoint - The server returns a lease ID and a TTL (which may be shorter than requested)
- The player sends the lease ID as an
X-Lease-Idheader on every key request - At 75% of the TTL, the player proactively renews the lease
- If the server revokes the lease, the next key request or renewal fails with 403
- The player emits
KEY_LEASE_EXPIREDand stops playback
Handle revocation
Lease options
When to use leases
- Subscription content: Revoke access when a user cancels their subscription
- Time-limited previews: Allow 5 minutes of free playback, then revoke
- Concurrent stream limits: Revoke the oldest session when the limit is exceeded
- Content takedowns: Immediately stop all active playback of removed content