DRM-X 6.0 dove and olive branch logoDRM-X 6.0Docs
◎ English

Web and HTML5 playback

Integrate DRM-X 6.0 protected Web playback with the Universal Player, qualified Shaka, PHP, ASP.NET Core, automatic DRM selection, and safe diagnostics.

View MarkdownLive examplesUpdated 2026-09-05

Encrypted video and DRM licenses follow separate paths

The CDN delivers encrypted video. Your backend checks access, and the DRM license service authorizes decryption on a compatible device.

  1. Storage / CDN

    Delivers encrypted media to the player.

  2. Your backend

    Checks whether the viewer is allowed to watch and requests playback authorization from DRM-X.

  3. DRM-X

    Validates the playback authorization and handles the DRM license request.

  4. Player + device

    Uses the device's DRM system to obtain a license and play the encrypted media.

Your backend decides access; DRM-X enforces the signed policy. Encrypted media and DRM licenses follow separate delivery paths.

Use the complete sample first#

The Web package contains the latest local Universal Player JavaScript and declarations, qualified Shaka, a runnable PHP application, a runnable ASP.NET Core example, and an integration README. Production pages may load Shaka and Universal Player from the DRM-X CDN; the package retains current local files for review, development, and controlled fallback.

  1. Set server-side Site ID, Site Key, and Access Key.
  2. Set the trusted Published protected file Content ID and named policy.
  3. Replace the sample login and entitlement decision with your business logic.

Minimal client boundary#

<script src="https://drm-x6-cdn.1aicloud.com/sdk/drmx-universal-player/v1/drmx-universal-player.js"></script>
<drmx-universal-player id="player"></drmx-universal-player>
<script>
  // Call your authenticated backend, not api6.drm-x.com.
  const session = await fetch('/api/playback/session', {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({contentId: 'trusted-catalog-reference'})
  }).then(r => r.json());
  await window.DrmXUniversalPlayer.start(document.querySelector('#player'), session);
</script>
The browser does not choose securityYour backend maps the authenticated user and trusted catalog reference to the DRM-X Content ID and policy template.

Automatic DRM behavior#

  • Windows Microsoft Edge prefers PlayReady. If the qualified PlayReady path fails before playback, Auto mode may use bounded Widevine fallback.
  • Chrome and supported Android browsers use Widevine.
  • Safari on iPhone and iPad uses native HLS FairPlay. On supported macOS Safari, qualified Shaka MSE FairPlay is preferred when available, with native HLS fallback.
  • Compatible Huawei browsers use the qualified WisePlay path and conservative automatic quality behavior.

Production checklist#

  • Serve everything over HTTPS and keep Access Keys in server secrets.
  • Return playback-session responses with Cache-Control: no-store.
  • Do not persist manifest URLs, tokens, or session responses in localStorage.
  • Keep detailed redacted logs opt-in and time-bounded; do not record license bytes or authorization.
  • Test physical Windows Edge, macOS Safari, iPhone/iPad Safari, Android, and every device class you advertise.
Web SDK

HTML5 playback with one Web Component#

<script
  src="https://drm-x6-cdn.1aicloud.com/shaka-player-5.2.4-drmx.2-6557ae581f1c.js"
  integrity="sha384-QzxDZ19XaYAL308fvtVjFjUX9RpRxtSfEZ1k1lm8FsRuML1MgNEORVMCtmToCFb8"
  crossorigin="anonymous"></script>
<script
  src="https://drm-x6-cdn.1aicloud.com/drmx-universal-player-1.2.0-preview.6-fa4b95431a9a.js"
  integrity="sha384-gwj1QszshenHjMEkHTTDEpozi6rbhsQgPlaq+aHBCgHiuEd2VK0P8tOB8BWaMQRr"
  crossorigin="anonymous"></script>

<drmx-universal-player
  content-id="course-12-lesson-4"
  content-type="vod"
  session-endpoint="/api/drmx/playback-session">
</drmx-universal-player>

The browser calls only your authenticated same-origin endpoint. Auto chooses the appropriate supported DRM and registered DASH/HLS manifest. Bitrate, audio language/channel, subtitles, Picture-in-Picture, fullscreen, and playback speed are built in.

Using Shaka, Video.js, Bitmovin, or another EME player

Request Contract v1 from your backend, load manifestUrl, and add Authorization: Bearer {drmLicenseToken} only to DRM license and FairPlay certificate requests. Preserve the opaque challenge and license response bytes exactly. Use the returned release route when playback ends.

Universal Player playlists and shared controls#

The Web and Android editions use a consistent dark settings panel with compact blue controls. Playlists support next/previous, shuffle, repeat one/all and cancellable automatic advance. Every item uses a new authorized playback request. Chapter and transcript metadata comes from your content catalog.

Playback speed, sleep timer, captions, permitted quality, audio languages, session bookmarks and A–B looping are available. Web adds keyboard shortcuts, optional viewer-scoped local resume, transcript search and supported browser PiP. Android retains native Widevine offline downloads and renewal. Casting and cross-device progress require separate application integrations.

Professional and Enterprise logo settings

Branding stays off the video surface. Right-click the Web player, or open Settings → About player on either edition, to see the authorized logo, product information and player version. The round settings control and dark menu style are shared with Android. The fullscreen Web settings also contain a playlist selector.

Set playerBranding in your trusted backend to {"mode":"hidden"} or {"mode":"custom","logoUrl":"https://your-site.example/logo.png","label":"Your brand"}. The platform checks the active Professional or Enterprise subscription. Other plans use {"mode":"default"}; unauthorized custom/hidden requests return 403. This is separate from security watermarks.

The PHP download includes editable playlist and branding configuration. The Android customer ZIP includes the playlist callback example. Keep playlist authorization in your backend; never embed API client credentials in either player.