samdutton / simpl

Simplest possible examples of HTML, CSS and Javascript:
https://simpl.info
Apache License 2.0
5.18k stars 1.64k forks source link

EME Clear Key Demo #122

Open Kiranmyway opened 6 years ago

Kiranmyway commented 6 years ago

Hi Sam,

Thanks for nice article! https://www.html5rocks.com/en/tutorials/eme/basics/

I am able to follow the instructions and able to encrypt the video using webm_crypt with some key and later I am using same key for decryption & video playback, the encrypted is getting fired, but decryption is not happening successfully.

my question is once we generate the key - how we are converting that to following uint8Array format?

if I convert the encryption key to base64 format & use it, it still does not work. Please help with your inputs/suggestions.

// Define a key: hardcoded in this example // This corresponds to the key used for encryption //var KEY = new Uint8Array([ // 0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b, // 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c //]);

Thanks, Kiran

samdutton commented 6 years ago

Thanks Kiran.

I'm not working so much on EME stuff now, so just checking for the best answer to your question.

Will keep you posted...

andrebarrett commented 4 years ago

@Kiranmyway Did you manage to get this working? I'm looking at the same thing and wondering where I'm going wrong trying to playback an MP4 file encrypted with CENC