Rahul Gaikwad
Rahul Gaikwad

Reputation: 589

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 .

Upvotes: 0

Views: 1432

Answers (3)

Kannaiyan
Kannaiyan

Reputation: 13025

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.

Upvotes: 2

AlexR1712
AlexR1712

Reputation: 59

If you have the signed URL's you only need to place it to the player setting. Check this

Edit: Should be easy to integrate.

Upvotes: 0

Scriptonomy
Scriptonomy

Reputation: 4055

A cloudfront signed url requires you to use your private key. In order to create signed urls on the client side you would need to disclose that private key. Disclosing a private key is never a good thing.

So in simple terms, you can't use a client side script to generate the signed url.

Upvotes: 2

Related Questions