Closed HP161 closed 4 years ago
As I mentioned in the documentation, the encryption is not a full DRM solution.
You can use DRM systems such as Apple's FairPlay, Microsoft's PlayReady, and Google's Widevine to securely exchange keys and protect playback on devices.
If you do not want to use any DRM system, I recommend protecting your key on your server.
Personally I use a CSRF token to restrict access to the key(s) to only users on my website (it blocks any Download Manager software like IDM to access to the key).
You can also use this technique by József Koller on Medium.
thanks @aminyazdanpanah
I can't anti download from tool download. my code here: //A path you want to save a random key to your local machine $save_to = base_path() . '/lib/' . $randomString . '/key'; //A URL (or a path) to access the key on your website $url = url('/') . '/lib/enc.key'; // or $url = '/"PATH TO THE KEY DIRECTORY"/key'; $format = new Streaming\Format\X264(); $format->on('progress', function ($video, $format, $percentage) { echo sprintf("\rTranscoding...(%s%%) [%s%s]", $percentage, str_repeat('#', $percentage), str_repeat('-', (99 - $percentage))); }); $video->hls() ->x264() ->setFormat($format) ->encryption($save_to, $url, 1) ->autoGenerateRepresentations([720, 360]) // You can limit the numbers of representatons ->save(base_path() . '/lib/' . $randomString . '/' . $randomString . '.m3u8');
please help, thanks!