This document describes how to encrypt a video and use the superplayer to play back the encrypted video.
Before reading this document, please make sure that you have read Stage 1. Play back a video with superplayer and Stage 2. Play back a video with hotlink protection enabled in the Superplayer Guide. This document uses the account activated and the video uploaded in stage 1, and hotlink protection needs to be enabled as instructed in stage 2.
Note:
SimpleAesEncryptPreset
is a preset task flow, which uses template 12 for adaptive bitrate streaming, template 10 for cover generating, and template 10 for image sprite capturing.- Adaptive bitrate streaming with template 12 is to output an encrypted multi-bitrate stream.
In the previous step, you have uploaded and processed the video. Now, you can use the superplayer for web, iOS, and Android to quickly preview video playback.
Select Media Assets > Video Management, find the video uploaded and processed in step 1, click Manage in the "Operation" column, and select Superplayer Preview.
Select "basicDrmPreset" as Superplayer Settings.
Note:
basicDrmPreset
is a preset superplayer configuration, which is used to output the adaptive bitstream with template 12 and the image sprite with template 10.
As hotlink protection is enabled for the default distribution domain name, you can set the hotlink protection expiration time and the preview duration on the Playback Control tab. You can use the default parameter settings here (the default expiration time of playback hotlink protection is 1 day, and the preview duration and maximum number of IPs allowed for playback are left empty).
In Web Player, click the button in the middle of the player, and you can play back the video on web.
The superplayer requires a signature within its validity period to play back the encrypted video. You can use the signature tool to quickly generate a signature as shown below.
appId
of video 1400xxx357
(if a subapplication is used, enter the subapplication's appId
).FileId
, which is 528xxx3757278095
.1591756516
here.basicDrmPreset
.5ee09b44
.2WExxx48eW
.Note:
basicDrmPreset
is a preset superplayer configuration, which is used to output the adaptive bitstream with template 12 and the image sprite with template 10.
After getting the superplayer signature, you can use the superplayer demos for web, Android, and iOS for verification. For more information, please see the demo source code.
Note:
In Media Assets > Video Management > Superplayer Preview in the console, you can get the corresponding web player source code for video preview for your reference.
At this point, you have understood how to encrypt a video and use the superplayer to play back the encrypted video.
Was this page helpful?