Файл: mp3/js_star/init.js
Строк: 73
<?php
player = document.getElementById('PlayerJsAudio');
var id = document.getElementById('PlayerJs').getAttribute('data-id');
var name = document.getElementById('id' + id).getAttribute('data-name');
document.getElementById('PlayerJs-Title').innerHTML = name;
document.getElementById('PlayerJs-Download').setAttribute('href', 'download/' + id)
player.src = 'http://poiskm.org/?do=getById&id=' + id;
document.getElementById('PlayerJs-Volume-Current').style.width = (player.volume * 100) + '%';
player.addEventListener('ended', function() {
PlayerNextFile(0)
}, false);
player.addEventListener('error', function() {
PlayerNextFile(0)
}, false);
player.addEventListener('play', function() {
name = document.getElementById('id'+Player('fileId')).getAttribute('data-name');
document.getElementById('PlayerJs-Title').innerHTML = name;
updateButtons()
}, false);
player.addEventListener('pause', function() {
updateButtons()
}, false);
player.addEventListener('timeupdate', function() {
var ld = Math.ceil(player.currentTime * 100 / player.duration);
document.getElementById('PlayerJs-Progress-Current').style.width = ld + '%';
document.getElementById('PlayerJs-Time').innerHTML = playerTime(player.currentTime);
var inc = 100 / player.duration;
for (i = 0; i < player.buffered.length; i++) {
var startX = player.buffered.start(i) * inc;
var endX = player.buffered.end(i) * inc;
var width = endX - startX;
}
document.getElementById('PlayerJs-Progress-Loaded').style.width = width + '%';
}, false);
?>