DRM-X 6.0 Taube und Olivenzweig LogoDRM-X 6.0Dokumentation
◎ Deutsch

ASP.NET Core Universal Player integration

Download the .NET 10 sample, configure server credentials, authenticate viewers and embed DRM-X 6.0 Universal Player with a protected playback endpoint.

Markdown anzeigenLive-BeispieleUpdated 2026-09-21

So wird die Wiedergabe autorisiert

Ihr Backend entscheidet, wer Inhalte ansehen darf. DRM-X stellt die Wiedergabeautorisierung bereit. Damit fordert der Player eine DRM-Lizenz an.

  1. Zuschauer

    Meldet sich bei Ihrem Dienst an und fordert ein Video an.

  2. Ihr Backend

    Prüft den Kauf, das Abonnement oder eine andere Zugriffsberechtigung des Nutzers.

  3. DRM-X

    Wendet die gewählten Wiedergaberegeln an und gibt Konfiguration und Autorisierung zurück.

  4. Player

    Fordert mit der erhaltenen Autorisierung die für die Wiedergabe benötigte DRM-Lizenz an.

Ihr Backend entscheidet über den Zugriff; DRM-X erzwingt die unterschriebene Richtlinie. Verschlüsselte Medien und DRM Lizenzen folgen getrennten Lieferwegen.

Before you begin#

Publish a protected video in DRM-X 6.0 and copy its Content ID. Create server integration credentials with license-tokens:create permission. Keep Site ID, Site Key and Access Key in server configuration; only short-lived playback data reaches the browser.

Serve the learning site over HTTPS. HTTP localhost works only on the same computer; an HTTP LAN address does not provide the secure context required for browser DRM. Test with a supported browser and your actual content.

Run the .NET 10 sample#

Download and extract the ASP.NET Core source ZIP. Open the aspnet directory, configure the server environment variables shown below and run dotnet run. Open http://127.0.0.1:8087 on the same computer. Select a trusted LicensePolicyTemplate in Program.cs that matches your published package.

DRMX_LOCAL_DEMO=1 explicitly enables a local demonstration identity. Remove the demonstration middleware and this switch before deployment, including deployment behind a loopback reverse proxy. Load real credentials through protected host configuration or a secret manager.

Download ASP.NET Core source

$env:DRMX_PLAYBACK_SITE_ID = "your-environment-uuid"
$env:DRMX_PLAYBACK_SITE_KEY = "drmx_your-client-id"
$env:DRMX_PLAYBACK_ACCESS_KEY = "drmx_secret_your-access-key"
$env:DRMX_CONTENT_ID = "your-published-content-id"
$env:DRMX_LOCAL_DEMO = "1"
dotnet run

Connect your existing ASP.NET Core application#

Copy DrmXPlaybackEndpoint.cs into your server project. Register AddDrmXPlayback with server-only credentials and policy. Implement IDrmXContentEntitlement using your active purchase, subscription or course records. The check receives ClaimsPrincipal, Content ID, content type and CancellationToken; return false for missing, expired or revoked access.

Register normal authentication and authorization middleware, and call MapDrmXPlaybackSession().RequireAuthorization(). The endpoint derives the viewer from an authenticated NameIdentifier claim. It requires a same-origin Origin header, JSON and a matching authorized content type. Configure trusted reverse proxies so the application sees the public HTTPS scheme and host.

Load the qualified Shaka and Universal Player scripts from the sample page, then embed the Web Component with content-id and session-endpoint. Keep the player page and session endpoint on the same origin. The sample authorizes one configured VOD Content ID; extend the server mapping deliberately when adding Live DRM.

<drmx-universal-player content-id="your-published-content-id"
  content-type="vod" session-endpoint="/api/drmx/playback-session">
</drmx-universal-player>

Test the application#

Run dotnet run --project tests/DrmX.AspNet.Acceptance.csproj from the extracted repository root. The 17 HTTP checks cover authentication, origin, content/type binding, server-owned policy and identity, revocation and upstream failures. They simulate DRM-X responses. Then test actual protected playback, Stop, renewal and the browsers you support with your own published content.

Integration source downloads · Universal Player Web guide · License policies · DRM for education · Multi-DRM protection