Skip to main content
Leases let you revoke a viewer’s access to content without re-encrypting the video. When enabled, the player acquires a time-limited lease from the key server and renews it automatically. If the lease is revoked server-side, the player stops playback and emits an error.

Enable leases

How it works

  1. When player.load() is called, the player requests a lease from the lease endpoint
  2. The server returns a lease ID and a TTL (which may be shorter than requested)
  3. The player sends the lease ID as an X-Lease-Id header on every key request
  4. At 75% of the TTL, the player proactively renews the lease
  5. If the server revokes the lease, the next key request or renewal fails with 403
  6. The player emits KEY_LEASE_EXPIRED and 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
See Key Server Leases for server-side setup.