Discussion:
video player for private videos from amazon s3
2***@public.gmane.org
2013-11-09 10:20:24 UTC
Permalink
The video player with my rails app is working fine when the video is public
inside of amazon s3. However i need the videos to be private.

I have added to my uploader the next code to protect the video:

class VideoUploader < CarrierWave::Uploader::Base
.
.
.
.
.

def fog_public
false
end

def fog_authenticated_url_expiration
5.minutes # in seconds from now, (default is 10.minutes)
end

end

The url is something like:

1.9.3p448 :011 > lesson.video
=>
https://mybucket.s3.amazonaws.com/videos/lesson_video/video/527cc9781d41c86d88000001/527cc9781d41c86d88000001_0b87bf02542675eb364d.mp4?AWSAccessKeyId=AKIAIDX34WHYKB3ZKFVA&Signature=USvjtADBRAiLf3sZgTf6PAc%2FRCQ%3D&Expires=1383911661

The current player can not play the file with this kind of urls.

I've tried with jwplayer, but does not work. Also. I've tried with
flowplayer, this is the flowplayer code:

<%= lesson.lesson_video.video.url %>

<div id="player" style="display:block;width:640px;height:300px;"></div>

<script>
$f("player",
"http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", {
clip: {
url: "<%= lesson.video.url %>",
autoPlay: true,
type: "video/mp4"
}

});
</script>

**Someone knows a player that can play private videos from amazon s3?**

**Or else I'm doing something wrong?**
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-11-11 14:56:13 UTC
Permalink
That seems reasonable at a glance, though I haven't worked with those video
players, so I may be missing things.

You may want to use a longer expiry, 5 minutes is cutting it pretty close.
With that short of an expiry if you have any clock skew it could really
throw things off. You might try extending the expiry a bit (and maybe also
using the sync_clock method on the fog storage object to ensure the clock
matches S3).
Post by 2***@public.gmane.org
The video player with my rails app is working fine when the video is
public inside of amazon s3. However i need the videos to be private.
class VideoUploader < CarrierWave::Uploader::Base
.
.
.
.
.
def fog_public
false
end
def fog_authenticated_url_expiration
5.minutes # in seconds from now, (default is 10.minutes)
end
end
1.9.3p448 :011 > lesson.video
=>
https://mybucket.s3.amazonaws.com/videos/lesson_video/video/527cc9781d41c86d88000001/527cc9781d41c86d88000001_0b87bf02542675eb364d.mp4?AWSAccessKeyId=AKIAIDX34WHYKB3ZKFVA&Signature=USvjtADBRAiLf3sZgTf6PAc%2FRCQ%3D&Expires=1383911661
The current player can not play the file with this kind of urls.
I've tried with jwplayer, but does not work. Also. I've tried with
<%= lesson.lesson_video.video.url %>
<div id="player" style="display:block;width:640px;height:300px;"></div>
<script>
$f("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf",
{
clip: {
url: "<%= lesson.video.url %>",
autoPlay: true,
type: "video/mp4"
}
});
</script>
**Someone knows a player that can play private videos from amazon s3?**
**Or else I'm doing something wrong?**
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...