ASP.NET Framework 4.8 video DRM integration
Embed DRM-X 6.0 Universal Player in ASP.NET Framework Web Forms or existing IIS applications with authenticated server authorization and a tested async handler.
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.
- Zuschauer
Meldet sich bei Ihrem Dienst an und fordert ein Video an.
- Ihr Backend
Prüft den Kauf, das Abonnement oder eine andere Zugriffsberechtigung des Nutzers.
- DRM-X
Wendet die gewählten Wiedergaberegeln an und gibt Konfiguration und Autorisierung zurück.
- Player
Fordert mit der erhaltenen Autorisierung die für die Wiedergabe benötigte DRM-Lizenz an.
Before you begin#
This integration targets ASP.NET Framework 4.8 and 4.8.1 on Windows and IIS, including Web Forms and existing ASP.NET applications. ASP.NET Core uses a separate sample. The Framework sample uses System.Web and does not require NuGet packages.
Prepare a published Content ID and server credentials with license-tokens:create permission. Keep Site ID, Site Key and Access Key on the server. Use HTTPS for deployment and the exact public origin of your application.
Download ASP.NET Framework source · Download complete Web integration kit
Run the Web Forms example#
Extract the source ZIP, open the folder containing Default.aspx and Web.config, then set the environment variables below in PowerShell before starting IIS Express. For the complete kit, the folder is examples/aspnet-framework. Open http://localhost:48087/Default.aspx on the same computer.
DRMX_LOCAL_DEMO=1 enables a loopback demonstration identity and authorizes only the configured VOD Content ID. Remove this switch before deployment, including deployment behind a local reverse proxy. Select the server policy in App_Code/DrmXPlayback.cs to match your encrypted package.
$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_PUBLIC_ORIGIN = "http://localhost:48087"
$env:DRMX_LOCAL_DEMO = "1"
& "$env:ProgramFiles/IIS Express/iisexpress.exe" "/path:$PWD" /port:48087 /systray:falseConnect authentication and content access#
Add App_Code/DrmXPlayback.cs and Playback.ashx to a Web Site project, or compile the C# class into your Web Application/MVC project. Merge the relevant Web.config settings with your existing application. Keep your normal authentication configuration.
Set ApplicationServices.Authorize in Application_Start to query your current purchase, subscription or course records. It receives the authenticated user identifier, Content ID and content type. Reject missing, expired or revoked access. The default implementation does not authorize real customer accounts.
The handler reads HttpContext.User, preferring the NameIdentifier claim and otherwise Identity.Name. Use a stable and unique identifier. Configure DRMX_PUBLIC_ORIGIN and credentials in the IIS application-pool environment, then recycle the pool after changes.
Embed Universal Player#
Copy the qualified script tags and Web Component from Default.aspx into your page. Keep Playback.ashx on the same origin and use an application-relative path for virtual directories. The handler checks authentication, Origin, JSON size, exact content/type and current entitlement before contacting DRM-X.
Verification and deployment#
Run powershell -File tests/run.ps1. The 21 service checks execute on the .NET Framework runtime with a simulated DRM-X upstream; ASP.NET precompilation also passed. IIS Express HTTP startup was blocked by access denial on the test machine, so an IIS-hosted end-to-end playback test is still required on your Windows server.
Test authenticated and denied users, content substitution, access revocation, real encrypted playback and Stop. The Linux documentation server hosts this download and guide; it does not run ASP.NET Framework applications.
Integration center and downloads · ASP.NET Core integration · Universal Player Web guide · Universal Player SDK
DRM-X 6.0