Skip to main content
Use the media item’s playback descriptor to load protected video in your existing player flow. This guide uses Shaka Player. See DRM support for supported media and environments.

1. Obtain the media through Access

From your backend, call the existing Access operation with the viewer’s authorized linked account. For a post, use posts:read:
Select the intended media item from the response. Pass its playback descriptor to your frontend through your application’s authenticated response. Keep your OAuth refresh token and OnlyFans session out of the player. If the item has no playback, use your existing ordinary-media path only when the response contains a viewable, unprotected media URL. Do not synthesize a descriptor from a raw manifest.

2. Attach the player

Install Shaka in your frontend project:
Render a video element with controls. In the following example, video is that element and playback is the descriptor from step 1.
Use your existing Play control to call video.play(). The basic browser support check does not guarantee Widevine or codec support; handle errors from player.load() too. Shaka sends the binary license challenge to the configured server. Do not add a JSON wrapper or parse the license as JSON. The Shaka DRM configuration guide describes the player setting. Use the returned URLs unchanged. No player request filter, cross-site cookie configuration, or browser origin override is required.

3. Renew without losing the playback position

Keep the current descriptor in a mutable playback variable. Add a renewal function next to the player initialization:
Wire the function into your player’s lifecycle:
  1. Schedule renewal before Date.parse(playback.expiresAt), for example 60 seconds early.
  2. After each renewal, schedule from the replacement descriptor’s expiry.
  3. Before resuming a long-paused video, renew if the descriptor has expired or is near expiry. Background timers can be delayed.
  4. If renewal returns an access denial, stop retries and refresh access through your backend. After the renewal URL expires, fetch a new media response.
  5. When the video component unmounts, clear its renewal timer, wait for an in-flight renewal to settle, and call await player.destroy().
Do not run renewal and player destruction at the same time. The function above shares one in-flight renewal between callers.

4. Verify playback on your application’s origin

Use a Live linked account and a DRM video that account can view. Open your real application on HTTPS or localhost. Confirm that the video advances, audio plays, and seeking works. Renew the descriptor and check that playback resumes at the prior position. Then revoke the relevant access and verify that subsequent media and license requests are denied. Previously buffered frames can remain visible. Inspect the manifest, resource, license, and renewal requests separately when playback fails. See Playback failures for recovery behavior. For retained media, take the descriptor from the Vault+ variant and use the same player integration. See Retain DRM video in Vault+.