Content Protection (DRM) Configuration
There are two ways for LuraPlayer to play encrypted content protected with Digital Rights Management (DRM) systems. LuraPlayer currently supports fairplay, widevine, and playready.
Adding DRM to Your Content From MCP
You can add DRM to your content from MCP without any configuration on the player side. Follow the guide in Adding DRM to Your Content From MCP page.
Adding External DRM
For each DRM system, the license URL and other necessary properties must be provided.
FairPlay
For fairplay, the licenseUrl and fairplayCertificate properties must be specified.
import React, { useRef } from "react";
import { LuraPlayer, LuraPlayerProps } from "lura-react-native-core";
export default function MySampleComponent() {
const playerRef = useRef<LuraPlayer>(null);
const config = {
url: "https://example.com/master.m3u8",
format: "hls",
licenseUrl: "YOUR_DRM_LICENSE_URL",
fairplayCertificate: "YOUR_FAIRPLAY_CERTIFICATE",
};
return (
<View>
<LuraPlayer ref={playerRef} config={config} />
</View>
);
}
Widevine
For widevine, only the licenseUrl property must be specified.
import React, { useRef } from "react";
import { LuraPlayer, LuraPlayerProps } from "lura-react-native-core";
export default function MySampleComponent() {
const playerRef = useRef<LuraPlayer>(null);
const config = {
url: "https://example.com/master.m3u8",
format: "hls",
licenseUrl: "YOUR_DRM_LICENSE_URL",
};
return (
<View>
<LuraPlayer ref={playerRef} config={config} />
</View>
);
}
Playready
For playready, only the licenseUrl property must be specified.
import React, { useRef } from "react";
import { LuraPlayer, LuraPlayerProps } from "lura-react-native-core";
export default function MySampleComponent() {
const playerRef = useRef<LuraPlayer>(null);
const config = {
url: "https://example.com/master.m3u8",
format: "hls",
licenseUrl: "YOUR_DRM_LICENSE_URL",
};
return (
<View>
<LuraPlayer ref={playerRef} config={config} />
</View>
);
}