I'm using AWS Lambda to create an elastic transcoder job with HLS content protection.
Following the doc here: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/content-protection.html At the end it says: "Note If you choose No Store, Elastic Transcoder returns your data key as part of the job object, but does not store it. You are responsible for storing the data key."
But I don't see a way to get the data key once the job is finished. In my AWS Lambda source code I have (javascript):
elastictranscoder.createJob(params, function(err, data) {
if (err) {
console.log('Error!', JSON.stringify(err, null, 2));
context.fail();
} else {
console.log('Success! Data: ', JSON.stringify(data, null, 2));
context.succeed();
}
});
The job completes successfully but I don't see a data key in the data object (when looking at the logs). My idea was to obtain it and add some code that stores the data key somewhere.
Thanks for any help!
As per documentation,
That means When the job is created, then we will find the
DataKey(key)
in the success response. Here is the response Object. You can find the data key inJob.Outputs.Encryption.Key
oryou can take the data key from AWS ElasticTranscoder Job details, just hover in Outputs section-> output key(lock icon), (encryption key is the data key) || or Playlists -> hover on master playlist
If you want to restrict or prevent the video from unauthorised users, you must implement authentication system on the License Acquisition URL, so that video player need to attach the data in order to be authenticated.