0

I want stream file m3u8 from Wowza Streaming to jwPlayer. I also want make video cannot read or download and i read in link: https://support.jwplayer.com/customer/portal/articles/1430261-aes-content-protection Follow link :

var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: 'sample_aes_stream.m3u8',
aestoken: 'EXAMPLE_AES_TOKEN'
});

i used AES Decryption to encrypt my video (.mp4) to index.m3u8 with many segment file (.ts). FIle m3u8 only read when have key file. But in below demo, i dont understand

jwplayer("myElement").setup({
file: 'sample_aes_stream.m3u8',
aestoken: 'EXAMPLE_AES_TOKEN'
});

What EXAMPLE_AES_TOKEN is ??? Follow link : http://iphim.vn/xem-phim-phut-giay-sinh-tu-3136.html u can see that i can't download video with IDM(internet download manager). I want to do it but dont know how to do it. Pls help me!

Hoang Nam
  • 101
  • 1
  • 10

2 Answers2

0

What EXAMPLE_AES_TOKEN is ???

It is key to decrypt video content


Please make sure that your JWPlayer support HLS-AES128 Encryption

The Enterprise edition has the ability to decrypt stream segments that are encrypted with AES-128. When encryption is used, the m3u8 playlist file needs to reference the corresponding key file so that the JW Player can retrieve the keys for decryption. The using the aestoken configuration, the player can also pass a token to the key request URI, enhancing the security of AES.

On wowza streaming, try How to secure Apple HTTP Live Streaming (AES-128 - external method)

  1. You need config at Wowza. Setup Key to Encode video.
  2. Key URL to provide Key to decrypt video content

For example. If We define key is "PATRICKZ-KEY" at Wowza. We need to use same key at Key URL

<?php
    header('Content-Type: binary/octet-stream');
    header('Pragma: no-cache');
    echo hex2bin('PATRICKZ-KEY');
}
?>
Patrickz
  • 680
  • 7
  • 11
0

The property aestoken is actually a token. IT IS NOT the key to decrypt the videos. A HLS video can hold, in its master playlist a tag with the url where you can obtain the aes key. For example, for a master playlist like

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:10, 
#EXT-X-KEY:METHOD=AES-128,URI="http://keyserver.com/key.enc",IV=0x1c341b1db8ff5399501511a99c8c7d14**
fileSequence0.ts
#EXTINF:10, 
fileSequence1.ts
#EXT-X-ENDLIST

The line with the tag #EXT-X-KEY holds the data to deal with aes decryption, including the url of the key.

The problem is that the resource pointed out by the url should be protected by something... which in most cases is a token (usually a JWT). So, jwplayer will do a get request to that url, appending a query param with key "token" and value equal to the value of the property "aestoken".

So, if your setup is

jwplayer("myElement").setup({
file: 'sample_aes_stream.m3u8',
aestoken: 'EXAMPLE_AES_TOKEN'
});

then with the example playlist of above, your jwplayer will do a get request of the form

http://keyserver.com/key.enc?token=EXAMPLE_AES_TOKEN 

to get the encryption key. Also, that query parameter is passed in the following requests of jwplayer.

Take a look at https://developer.jwplayer.com/jwplayer/docs/jw8-enable-aes-decryption.

JuanDM
  • 1