Search code examples
javascriptamazon-web-servicesamazon-s3amazon-cloudfrontaws-sdk-js

How to create AWS CloudFront signed url for s3 video using javascript sdk without NodeJs


I have some videos in my aws S3 bucket , I want to play these videos using jwplayer with CloudFront signed URLs .

I have created signed URLs using aws PHP sdk and its working fine. But, I want the same thing with aws javascript sdk , without using any nodeJs module , Need simple javascript script with HTML .

Please share suggestion , if anyone done this thing .

Thank you in advance .


Solution

  • Here is the documentation to generate SignedURL with Javascript.

    http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrl-property

    Yo need to share your private key, which is dangerous and not an acceptable practice.

    Cloudfront Signed URL SDK for Javascript:

    http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront/Signer.html

    Hope it helps.