Choose your PHP download
SDK example: Composer package, one application example and findAuthorizedVideo($userId, $videoId). Best starting point for an existing PHP website.
Download complete PHP demo
Complete demo: PHP 8.2+ and cURL; no Composer or database. Includes playlist, diagnostics and token-proxy examples. Uses a source adapter. Verify its SHA-256.
How it works
No manifest URL is needed in your streaming integration. For 1aicloud or configured S3 storage, DRM-X uses the media URLs recorded when the package is published. For encrypted files uploaded to your own server, register their DASH/HLS media URLs in DRM-X first. Then use the same Content ID in PHP, ASP.NET or any other integration. Your server still checks the current user’s permission before requesting playback.
- Your website signs in the viewer. Keep your own customer account.
- Your server checks access. Resolve the lesson or purchase to the permitted DRM-X Content ID.
- DRM-X authorizes playback. Your server uses its credentials to request a playback session.
- Universal Player plays the video. Server credentials stay off the browser.
Run this complete demo with your video
- Extract the complete demo ZIP and open
config/drmx.php. - Set
siteId, siteKey, accessKey and content.id using the same DRM-X environment. Choose vod or live and a policy matching your package. Keep the rest of the configuration. - Run a launcher below, open
http://127.0.0.1:8086/ and press Play.
# Windows PowerShell, inside the extracted folder:
powershell -NoProfile -ExecutionPolicy Bypass -File .\run-local.ps1
# macOS / Linux:
bash ./run-local.sh
Only config/drmx.php needs changing for the first playback test. Supply Content ID to select your video; DRM-X returns its registered manifest automatically. The sample supplies a local demo viewer. Your production website needs the login and permission changes below.
What to change for your customers
1. Credentials and policy
config/drmx.phpStore server credentials and select your policy. Disable all demo login options before production.
2. Login and permission
src/bootstrap.phpConnect authenticated_user_id() and user_can_play_content() to your existing login and current access rules.
3. Content and player
src/bootstrap.php + public/index.phpReplace the demo catalog lookup with your own video mapping. Render the authorized Content ID and keep the server checks.
You do not need a second purchase, membership or enrollment database. The browser’s Content ID is a request, so your server must authorize it on every new session.
Follow the full tutorial
The download includes the complete endpoints, launchers and README. The English guide explains both PHP paths, exact files to modify, policy selection and production checks.