Файл: mp3/class.PlayerJsTpl.php
Строк: 68
<?php
class PlayerJsTpl
{
// Js файл плеера с функциями управления
static public $javascript = '/mp3/js/player.min.js';
static public $init = '/mp3/js/init.min.js';
static public $css = '/mp3/css/player.css';
// Подключение JS и Стилей
static public function InitJsCss()
{
$ver_css = filemtime($_SERVER['DOCUMENT_ROOT'] . self::$css);
$ver_js = filemtime($_SERVER['DOCUMENT_ROOT'] . self::$javascript);
$html = '<link rel="stylesheet" href="' . self::$css . '?ver=' . $ver_css . '" type="text/css" />';
$html .= '<script type="text/javascript" src="' . self::$javascript . '?ver=' . $ver_js . '"></script>';
echo $html;
}
// Вывод активного плеера
public static function getPlayer($id = 0, $end = 0, $page = 1, $pages_all = 1)
{
$html = '<table data-id="' . $id . '"
data-end="' . $end . '"
data-page="' . $page . '"
data-pages="' . $pages_all . '" class="PlayerJs" id="PlayerJs" border="0"><tr>';
$html .= '<td class="PlayerJs-Play" onclick="Player('toggle', '0')"><i id="PlayerJs-Play" class="gfx play"></i></td>';
$html .= '<td class="PlayerJs-Progress">
<div id="PlayerJs-Title"></div>
<div id="PlayerJs-Progress" onclick="playerSeek(event)">
<div id="PlayerJs-Progress-Loaded"></div>
<div id="PlayerJs-Progress-Current"></div>
</div>
</td>';
$html .= '<td class="PlayerJs-Time"><span id="PlayerJs-Time">00:00</span></td>';
$html .= '<td class="PlayerJs-Volume"><div id="PlayerJs-Volume" onclick="playerVolume(event)"><div id="PlayerJs-Volume-Current"></div></div></td>';
$html .= '<td class="PlayerJs-Download"><a id="PlayerJs-Download" target="_blank" href=""><i class="gfx download"></i></a></td>';
$html .= '</tr></table>';
$html .= '<audio id="PlayerJsAudio" preload="none"></audio>';
echo $html;
}
// Вывод мини плеера
public static function getPlayerMini($i = 0, $zona)
{
$html = '<div class="' . ($i % 2 ? "nav1" : "nav2") . ' mp3list" id="id' . $zona[1][$i] . '"
data-id="' . $zona[1][$i] . '"
data-download="download/' . $zona[1][$i] . '"
data-name="' . $zona[4][$i] . ' - ' . $zona[6][$i] . '">';
$html .= '<i class="fas fa-music"></i> ' . $zona[4][$i] . ' - ' . $zona[6][$i] . ' <span style="float:right;font-size: 12px;"><i class="far fa-clock"></i> ' . $zona[8][$i] . '</span><br /><br />';
$html .= '<a class="btn-mp3" onclick="Player('toggle', ''.$zona[1][$i].''); return false;">
<i id="mp3play-'.$zona[1][$i].'" class="gfx play"></i>
</a>';
$html .= '<a class="btn-mp3 btn-download" href="download/' . $zona[1][$i] . '">
<i id="mp3play-'.$zona[1][$i].'" class="gfx download"></i> Скачать
</a>';
$html .= '</div>';
echo $html;
}
// Инициализация плеера
public static function Init()
{
$ver_init = filemtime($_SERVER['DOCUMENT_ROOT'] . self::$init);
$html = '<script type="text/javascript" src="' . self::$init . '?ver=' . $ver_init . '"></script>';
echo $html;
}
}