Код ретранслятора:
<?php
$url = base64_decode($_GET['play']);
$header = get_headers($url, 0);
$fp = fopen($url, "rb") or die ('not found');
if(isset($header))
{
foreach($header as $val) header($val);
}
while(!feof($fp))
{
echo fread($fp, 10240);
}
?>
Код перемотки:
$('.audio-progress').click(function (e) {
var posX = $(this).offset().left,
posY = $(this).offset().top;
var clickpos = ((e.pageX - posX)/$(this).outerWidth());
var audio = $(this).parent().find("audio").get(0);
audio.currentTime = clickpos * audio.duration;
});
Код самого плеера:
<div class="player" id="ид(от 1 до n)">
<div class="play-audio vcentera" style="cursor: pointer; z-index: 401;"></div>
<div class="pause-audio vcentera" style="z-index: 400; cursor: pointer"></div>
<div class="audio-name" style="overflow: hidden; position: absolute; top: 15%; color: #393e42"><pre style="margin: 0 !important;">Автор - Песня</pre></div>
<div class="audio-progress" style="position: absolute; bottom: 15%; background: #eee; z-index: 499">
<div class="buffer-progress" style="position: absolute; top: 0; left: 0; width: 0%; height: 100%; z-index: 500; background: #bfb6f9"></div>
<div class="playing-progress" style="position: absolute; top: 0; left: 0; width: 0%; height: 100%; z-index: 501; background: #577ca1"></div>
</div>
<audio src='http://site.ru/retranslator?play=ссылка в base64' style='display: none'></audio>
</div>