Search code examples
amazon-cloudfront

Restricting Time access for AWS Cloudfront


I'm not sure if this is possible, but can I set up a "time limit" on Amazon CloudFront w/ RTMP? For example, if a movie is 10 mins, I want to show the first two mins only.

Can this be done through CloudFront or do I need to create a proxy script?

Thanks


Solution

  • No, the closest to what you want is ability to sign URLs which allows to limit how long URL is valid.

    But unfortunately:

    RTMP distributions: CloudFront checks the expiration time in a signed URL at the start of a play event. If a client starts to play a media file before the expiration time passes, CloudFront allows the entire media file to play. However, depending on the media player, pausing and restarting might trigger another play event. Skipping to another position in the media file will trigger another play event. If the subsequent play event occurs after the expiration time passes, CloudFront won't serve the media file.

    (from official manual: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls-overview.html)