NFT-based DRM
How to create a video protected by Theta NFT-based DRM
DRM protected videos are created following the exact same steps like normal videos, except that you can now specify a NFT collection so that users must own at least one NFT from that collection to be able to watch the video.
The created videos are encrypted and only NFT owners will be granted access to decryption keys.
Publishing the video
Option 1: You can share the playback URL directly with your viewers.
Option 2: You can embed the iframe on your website.
Watch the video
Either way, the video is initially blocked and the viewer is asked to connect their MetaMask wallet.
After signing in, Theta DRM server will verify whether the viewer owns NFT items from the collection specified by the video creator. If true, the decryption key is granted to the viewer' player to decode and play the video.
Optional: Customize The UI
You can leverage our Javascript SDK to enhance the experience for users who do not yet have access to the video content. This tool allows you to personalize the "access denied" screen to align with your brand, such as displaying your logo or including a link to purchase the related NFT.
Here's an example using the TVA Javascript SDK:
const tva = new TVA.Video({
videoId: 'video_m3jxh0abh8p6vwejd0av1p9yg2',
videoEl,
onAccessOK,
onAccessDenied,
onError,
networkId: 365
})
// Set up event listeners on custom block screen
async function onConnectWalletClick() {
await tva.signin()
}
connectWalletBtn.addEventListener('click', onConnectWalletClick)
To explore a full working example, check out our demo and dive into the source code here: https://drm.thetavideoapi.com/demo/
Updated 8 months ago