Playing Widevine DRM with Secure S3 URLs
mthottem opened this issue · comments
Did anyone have success with playing content that is in private S3 buckets? I send the presigned url for the mpd file to the player but I get a 403 Forbidden error for the proxy and audio because the manifest is trying to access private content without having presigned urls.
Are you delivering the content directly from S3 or via Cloudfront?
Trying to do it directly via S3
If you are delivering through CloudFront, then my answer is(even if are accesing from S3 directly concept is same here):
You are accessing manifest MPD file using presigned URLs(also called as signedUrls), but you are not creating signedurls for the remaining files like .mp4, .m4s,...
why we should create presignedurls for mp4, m4s files?
If all the objects in S3 are Private then you should create each presigned url for every object.
It is not possible to create presigned urls for all mpd, mp4,m4s files at a single time.
you should handle at player side, in the way that whenever the player is requesting URL you should create presigned URL for that URL using xhrbefore request. but is not a good way.
we have another way to play the video using signed cookies.
we can create signed cookies in two ways using canned policy and custom policy.
for more info about types of cookies, read at https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html#private-content-choosing-canned-custom-cookies
you should create cookies using custom policy, then your video will play.
I got this to work by editing the MPD file directly and signing the baseURLs and uploading the MPD back to S3. Hope it helps someone in the future!