Hey i am using some php code to mask urls from s3 so users can't see the files are coming from there but it is causing such a large amount of lag if you try to visit other pages at the same time.
I'll post my code and hopefully there is a better method perhaps or a solution to the slowdown(to the point other pages error out).
The rewrite
function videofile()
{
//echo S3PATH.'video_gallery/'.$video['cat_ID'].'/'.$video['video'];
if(isset($_SESSION['member']))
{
$filename = $this->uri->segment(4);
$cat_id = $this->uri->segment(3);
$img = $this->images->imageID();
$ref = '/photos/'.$cat.'/view/';
header("video/x-flv");
unset($url);
$url = "http://s3.amazonaws.com/mysite/video_gallery/".$cat_id."/".$filename;
readfile($url);
}
else
{
redirect('/');
}
}
The file
<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="<?php echo $player_width; ?>" height="<?php echo $player_height; ?>">
<param name="movie" value="<?php echo base_url();?>movies/player.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=<?php echo site_url() ?>gallery/videofile/<?php echo $video['cat_ID']?>/<?php echo $video['video']?>&image=<?php echo site_url() ?>gallery/videoimage/<?php echo $video['thumb'] ?>" />
<embed
type="application/x-shockwave-flash"
id="player2"
name="player2"
src="<?php echo base_url();?>movies/player.swf"
width="<?php echo $player_width; ?>"
height="<?php echo $player_height; ?>"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=<?php echo site_url() ?>gallery/videofile/<?php echo $video['cat_ID']?>/<?php echo $video['video']?>&image=<?php echo site_url() ?>gallery/videoimage/<?php echo $video['thumb'] ?>" />
</object>
<?php
/* SWF OBJECT METHOD - IE6 BUGS
<script type="text/javascript">
var flashvars = {
'file': 'video.flv',
'autostart': 'false'
};
var params = {
'allowfullscreen': 'true',
'allowscriptaccess': 'always',
'bgcolor': '#ffffff'
};
var attributes = {};
swfobject.embedSWF("/movies/player.swf", "flashContent", "600", "450", "9.0.0", "/movies/expressInstall.swf", flashvars, params, attributes);
</script>
<div id="flashContent" class="clearfix">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>*/
?>