mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-14 21:26:37 +00:00
PVL API phase 1!
This commit is contained in:
parent
4ff2003a05
commit
ef1e1f117d
|
@ -10,7 +10,7 @@ $skin = \PVL\Customization::get('theme');
|
||||||
<li class="divider"> </li>
|
<li class="divider"> </li>
|
||||||
<li><a href="<?=$this->route(array('controller' => 'account', 'action' => 'theme', 'skin' => 'toggle')) ?>"><i class="icon-adjust"></i> <? if ($skin == 'light'): ?>Dark Theme<? else: ?>Light Theme<? endif; ?></a></li>
|
<li><a href="<?=$this->route(array('controller' => 'account', 'action' => 'theme', 'skin' => 'toggle')) ?>"><i class="icon-adjust"></i> <? if ($skin == 'light'): ?>Dark Theme<? else: ?>Light Theme<? endif; ?></a></li>
|
||||||
<li class="divider"> </li>
|
<li class="divider"> </li>
|
||||||
<li><a href="<?=$this->route(array('module' => 'default', 'controller' => 'index', 'action' => 'tunein', 'origin' => 'home')) ?>" id="btn-tune-in"><i class="icon-youtube-play"></i> Player</a></li>
|
<li><a href="<?=$this->route(array('module' => 'mobile')) ?>" id="btn-tune-in"><i class="icon-youtube-play"></i> Player</a></li>
|
||||||
<li class="divider"> </li>
|
<li class="divider"> </li>
|
||||||
<li><a href="<?=$this->route(array('module' => 'default', 'controller' => 'index', 'action' => 'app')) ?>"><i class="icon-cloud-download"></i> Plugins & Apps</a></li>
|
<li><a href="<?=$this->route(array('module' => 'default', 'controller' => 'index', 'action' => 'app')) ?>"><i class="icon-cloud-download"></i> Plugins & Apps</a></li>
|
||||||
<li class="divider"> </li>
|
<li class="divider"> </li>
|
||||||
|
|
|
@ -60,10 +60,12 @@ echo $this->headLink()."\n";
|
||||||
echo $this->headScript()."\n";
|
echo $this->headScript()."\n";
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
document.domain = 'ponyvillelive.com';
|
||||||
var DF_ContentPath = '<?php echo \DF\Url::content(); ?>';
|
var DF_ContentPath = '<?php echo \DF\Url::content(); ?>';
|
||||||
|
var DF_IsApp = false;
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="<?=$this->body_class ?>">
|
<body>
|
||||||
<!-- Google Universal Analytics -->
|
<!-- Google Universal Analytics -->
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
@ -76,50 +78,52 @@ ga('send', 'pageview');
|
||||||
</script>
|
</script>
|
||||||
<!-- End Google Universal Analytics -->
|
<!-- End Google Universal Analytics -->
|
||||||
|
|
||||||
<!-- Header -->
|
<div id="webapp">
|
||||||
<div data-role="header" data-position="fixed" data-tap-toggle="false" data-theme="a">
|
<!-- Header -->
|
||||||
<a id="btn_back" href="#" data-rel="back" class="ui-btn-left ui-alt-icon ui-nodisc-icon ui-btn ui-icon-carat-l ui-btn-icon-notext ui-corner-all" data-role="button" role="button">Back</a>
|
<div data-role="header" data-position="fixed" data-tap-toggle="false" data-theme="a">
|
||||||
<h1><?=$title ?></h1>
|
<a id="btn_back" href="#" data-rel="back" class="ui-btn-left ui-alt-icon ui-nodisc-icon ui-btn ui-icon-carat-l ui-btn-icon-notext ui-corner-all" data-role="button" role="button">Back</a>
|
||||||
</div>
|
<h1><?=$title ?></h1>
|
||||||
|
|
||||||
<!-- Main Body -->
|
|
||||||
<div id="page" data-role="page" data-title="<?=$title ?>" class="jqm-demos">
|
|
||||||
<div role="main" class="ui-content jqm-content jqm-fullwidth">
|
|
||||||
<?php echo $this->layout()->content; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Footer Nav -->
|
|
||||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false" data-theme="a">
|
|
||||||
<div id="player_controls" data-role="controlgroup">
|
|
||||||
<a class="ui-corner-all ui-btn ui-btn-left" id="player_pause">Stop</a>
|
|
||||||
<input type="range" class="volume_slider" name="player_volume" id="player_volume" min="0" max="100" value="50" data-role="none" data-highlight="true">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-role="navbar">
|
<!-- Main Body -->
|
||||||
<ul>
|
<div id="page" data-role="page" data-title="<?=$title ?>" class="jqm-demos">
|
||||||
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'radio')) ?>">
|
<div role="main" class="ui-content jqm-content jqm-fullwidth">
|
||||||
<span class="icon"><i class="fa fa-music"></i></span>
|
<?php echo $this->layout()->content; ?>
|
||||||
<span class="tab-label">Radio</span>
|
</div>
|
||||||
</a></li>
|
|
||||||
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'video')) ?>">
|
|
||||||
<span class="icon"><i class="fa fa-video-camera"></i></span>
|
|
||||||
<span class="tab-label">Video</span>
|
|
||||||
</a></li>
|
|
||||||
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'show')) ?>">
|
|
||||||
<span class="icon"><i class="fa fa-rss"></i></span>
|
|
||||||
<span class="tab-label">Shows</span>
|
|
||||||
</a></li>
|
|
||||||
<li><a href="<?=$this->route(array('module' => 'mobile', 'controller' => 'requests')) ?>">
|
|
||||||
<span class="icon"><i class="fa fa-comments"></i></span>
|
|
||||||
<span class="tab-label">Requests</span>
|
|
||||||
</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Radio Player -->
|
<!-- Footer Nav -->
|
||||||
<div id="pvl-jplayer" style="width: 0; height: 0;"></div>
|
<div data-role="footer" data-position="fixed" data-tap-toggle="false" data-theme="a">
|
||||||
|
<div id="player_controls" data-role="controlgroup">
|
||||||
|
<a class="ui-corner-all ui-btn ui-btn-left" id="player_pause">Stop</a>
|
||||||
|
<input type="range" class="volume_slider" name="player_volume" id="player_volume" min="0" max="100" value="50" data-role="none" data-highlight="true">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div data-role="navbar">
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'radio')) ?>">
|
||||||
|
<span class="icon"><i class="fa fa-music"></i></span>
|
||||||
|
<span class="tab-label">Radio</span>
|
||||||
|
</a></li>
|
||||||
|
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'video')) ?>">
|
||||||
|
<span class="icon"><i class="fa fa-video-camera"></i></span>
|
||||||
|
<span class="tab-label">Video</span>
|
||||||
|
</a></li>
|
||||||
|
<li><a href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'show')) ?>">
|
||||||
|
<span class="icon"><i class="fa fa-rss"></i></span>
|
||||||
|
<span class="tab-label">Shows</span>
|
||||||
|
</a></li>
|
||||||
|
<li><a href="<?=$this->route(array('module' => 'mobile', 'controller' => 'requests')) ?>">
|
||||||
|
<span class="icon"><i class="fa fa-comments"></i></span>
|
||||||
|
<span class="tab-label">Requests</span>
|
||||||
|
</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Radio Player -->
|
||||||
|
<div id="pvl-jplayer" style="width: 0; height: 0;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -14,12 +14,50 @@ class Api extends \DF\Controller\Action
|
||||||
|
|
||||||
// Disable rendering.
|
// Disable rendering.
|
||||||
$this->doNotRender();
|
$this->doNotRender();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Allow AJAX retrieval.
|
// Allow AJAX retrieval.
|
||||||
|
header('Content-Type: application/json');
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
|
||||||
|
// Log request.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function requireKey()
|
||||||
|
{
|
||||||
|
$this->returnError('API keys are not yet implemented.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Result Printout
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function returnSuccess($data)
|
||||||
|
{
|
||||||
|
$this->returnJson(array(
|
||||||
|
'status' => 'success',
|
||||||
|
'result' => $data,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function returnError($message)
|
||||||
|
{
|
||||||
|
$this->returnJson(array(
|
||||||
|
'status' => 'error',
|
||||||
|
'error' => $message,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function returnJson($obj)
|
||||||
|
{
|
||||||
|
echo json_encode($obj, JSON_UNESCAPED_SLASHES);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,6 +8,8 @@ class Mobile extends \DF\Controller\Action
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
\Zend_Layout::getMvcInstance()->setLayout('mobile');
|
\Zend_Layout::getMvcInstance()->setLayout('mobile');
|
||||||
|
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function preDispatch()
|
public function preDispatch()
|
||||||
|
|
|
@ -5,6 +5,7 @@ use \Entity\Statistic;
|
||||||
use \Entity\Schedule;
|
use \Entity\Schedule;
|
||||||
use \Entity\Station;
|
use \Entity\Station;
|
||||||
use \Entity\Song;
|
use \Entity\Song;
|
||||||
|
use \Entity\Settings;
|
||||||
|
|
||||||
class NowPlaying
|
class NowPlaying
|
||||||
{
|
{
|
||||||
|
@ -54,7 +55,7 @@ class NowPlaying
|
||||||
$pvl_file_path = self::getFilePath('nowplaying');
|
$pvl_file_path = self::getFilePath('nowplaying');
|
||||||
|
|
||||||
$nowplaying = self::loadNowPlaying();
|
$nowplaying = self::loadNowPlaying();
|
||||||
$nowplaying_feed = json_encode($nowplaying);
|
$nowplaying_feed = json_encode($nowplaying, JSON_UNESCAPED_SLASHES);
|
||||||
@file_put_contents($pvl_file_path, $nowplaying_feed);
|
@file_put_contents($pvl_file_path, $nowplaying_feed);
|
||||||
|
|
||||||
// Write shorter delimited file.
|
// Write shorter delimited file.
|
||||||
|
@ -200,7 +201,10 @@ class NowPlaying
|
||||||
|
|
||||||
list($artist, $track) = explode(' - ', $return['SERVERTITLE'], 2);
|
list($artist, $track) = explode(' - ', $return['SERVERTITLE'], 2);
|
||||||
|
|
||||||
$np['listeners'] = (int)$return['UNIQUELISTENERS'];
|
$np['listeners_unique'] = (int)$song_data['UNIQUELISTENERS'];
|
||||||
|
$np['listeners_total'] = (int)$song_data['CURRENTLISTENERS'];
|
||||||
|
$np['listeners'] = self::getListenerCount($np['listeners_unique'], $np['listeners_total']);
|
||||||
|
|
||||||
$np['artist'] = $artist;
|
$np['artist'] = $artist;
|
||||||
$np['title'] = $track;
|
$np['title'] = $track;
|
||||||
$np['text'] = $return['SERVERTITLE'];
|
$np['text'] = $return['SERVERTITLE'];
|
||||||
|
@ -274,7 +278,11 @@ class NowPlaying
|
||||||
$np['title'] = $title;
|
$np['title'] = $title;
|
||||||
$np['artist'] = $artist;
|
$np['artist'] = $artist;
|
||||||
$np['text'] = $song_data['SONGTITLE'];
|
$np['text'] = $song_data['SONGTITLE'];
|
||||||
$np['listeners'] = (int)$song_data['UNIQUELISTENERS'];
|
|
||||||
|
$np['listeners_unique'] = (int)$song_data['UNIQUELISTENERS'];
|
||||||
|
$np['listeners_total'] = (int)$song_data['CURRENTLISTENERS'];
|
||||||
|
$np['listeners'] = self::getListenerCount($np['listeners_unique'], $np['listeners_total']);
|
||||||
|
|
||||||
$np['is_live'] = 'false'; // ($song_data['NEXTTITLE'] != '') ? 'false' : 'true';
|
$np['is_live'] = 'false'; // ($song_data['NEXTTITLE'] != '') ? 'false' : 'true';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -294,7 +302,10 @@ class NowPlaying
|
||||||
|
|
||||||
list($artist, $title) = explode(" - ", $parts[6], 2);
|
list($artist, $title) = explode(" - ", $parts[6], 2);
|
||||||
|
|
||||||
$np['listeners'] = (int)$parts[0];
|
$np['listeners_unique'] = (int)$parts[4];
|
||||||
|
$np['listeners_total'] = (int)$parts[0];
|
||||||
|
$np['listeners'] = self::getListenerCount($np['listeners_unique'], $np['listeners_total']);
|
||||||
|
|
||||||
$np['title'] = $title;
|
$np['title'] = $title;
|
||||||
$np['artist'] = $artist;
|
$np['artist'] = $artist;
|
||||||
$np['text'] = $parts[6];
|
$np['text'] = $parts[6];
|
||||||
|
@ -488,13 +499,13 @@ class NowPlaying
|
||||||
// Pull from current NP data if song details haven't changed.
|
// Pull from current NP data if song details haven't changed.
|
||||||
if (strcmp($np['text'], $current_np_data['text']) == 0)
|
if (strcmp($np['text'], $current_np_data['text']) == 0)
|
||||||
{
|
{
|
||||||
$np['image'] = $current_np_data['image'];
|
// $np['image'] = $current_np_data['image'];
|
||||||
$np['song_id'] = $current_np_data['song_id'];
|
$np['song_id'] = $current_np_data['song_id'];
|
||||||
$np['song_history'] = $current_np_data['song_history'];
|
$np['song_history'] = $current_np_data['song_history'];
|
||||||
}
|
}
|
||||||
else if (empty($np['text']))
|
else if (empty($np['text']))
|
||||||
{
|
{
|
||||||
$np['image'] = $np['logo'];
|
// $np['image'] = $np['logo'];
|
||||||
$np['song_id'] = NULL;
|
$np['song_id'] = NULL;
|
||||||
$np['song_history'] = $station->getRecentHistory();
|
$np['song_history'] = $station->getRecentHistory();
|
||||||
}
|
}
|
||||||
|
@ -505,8 +516,8 @@ class NowPlaying
|
||||||
self::notifyStation($station, 'offline');
|
self::notifyStation($station, 'offline');
|
||||||
|
|
||||||
// Fetch new NP image in the event of a changed song.
|
// Fetch new NP image in the event of a changed song.
|
||||||
$np['image'] = $np['logo'];
|
// $np['image'] = $np['logo'];
|
||||||
$station->nowplaying_image = $np['image'];
|
// $station->nowplaying_image = $np['image'];
|
||||||
|
|
||||||
// Register a new item in song history.
|
// Register a new item in song history.
|
||||||
$np['song_history'] = $station->getRecentHistory();
|
$np['song_history'] = $station->getRecentHistory();
|
||||||
|
@ -601,4 +612,17 @@ class NowPlaying
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getListenerCount($unique_listeners = 0, $current_listeners = 0)
|
||||||
|
{
|
||||||
|
$unique_listeners = (int)$unique_listeners;
|
||||||
|
$current_listeners = (int)$current_listeners;
|
||||||
|
|
||||||
|
if ($unique_listeners == 0 || $current_listeners == 0)
|
||||||
|
return max($unique_listeners, $current_listeners);
|
||||||
|
else
|
||||||
|
return min($unique_listeners, $current_listeners);
|
||||||
|
|
||||||
|
// return round(($unique_listeners + $unique_listeners + $current_listeners) / 3);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -289,6 +289,19 @@ class Station extends \DF\Doctrine\Entity
|
||||||
return $lookup;
|
return $lookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function findByShortCode($short_code)
|
||||||
|
{
|
||||||
|
$short_names = self::getShortNameLookup();
|
||||||
|
|
||||||
|
if (isset($short_names[$short_code]))
|
||||||
|
{
|
||||||
|
$id = $short_names[$short_code]['id'];
|
||||||
|
return self::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCategories()
|
public static function getCategories()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|
|
@ -3,6 +3,14 @@ class Api_IndexController extends \PVL\Controller\Action\Api
|
||||||
{
|
{
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
$this->returnSuccess('The PVL! API is online and functioning. For more information, visit http://docs.ponyvillelive.apiary.io/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function statusAction()
|
||||||
|
{
|
||||||
|
$this->returnSuccess(array(
|
||||||
|
'online' => 'true',
|
||||||
|
'timestamp' => time(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
48
app/modules/api/controllers/NowplayingController.php
Normal file
48
app/modules/api/controllers/NowplayingController.php
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
use \Entity\Station;
|
||||||
|
|
||||||
|
class Api_NowplayingController extends \PVL\Controller\Action\Api
|
||||||
|
{
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
if ($this->_hasParam('id'))
|
||||||
|
{
|
||||||
|
$id = (int)$this->_getParam('id');
|
||||||
|
$station = Station::find($id);
|
||||||
|
|
||||||
|
if (!($station instanceof Station))
|
||||||
|
return $this->returnError('Station not found!');
|
||||||
|
else
|
||||||
|
return $this->returnSuccess($station->nowplaying_data);
|
||||||
|
}
|
||||||
|
elseif ($this->_hasParam('station'))
|
||||||
|
{
|
||||||
|
$short_names = Station::getShortNameLookup(true);
|
||||||
|
$short = $this->_getParam('station');
|
||||||
|
|
||||||
|
if (isset($short_names[$short]))
|
||||||
|
{
|
||||||
|
$data = $short_names[$short];
|
||||||
|
return $this->returnSuccess($data['nowplaying_data']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $this->returnError('Station not found!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$return_raw = $this->em->createQuery('SELECT s.name, s.nowplaying_data FROM Entity\Station s WHERE s.is_active = 1 ORDER BY s.weight ASC')
|
||||||
|
->getArrayResult();
|
||||||
|
|
||||||
|
$np = array();
|
||||||
|
foreach($return_raw as $row)
|
||||||
|
{
|
||||||
|
$short_name = Station::getStationShortName($row['name']);
|
||||||
|
$np[$short_name] = $row['nowplaying_data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->returnSuccess($np);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
95
app/modules/api/controllers/ScheduleController.php
Normal file
95
app/modules/api/controllers/ScheduleController.php
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
<?php
|
||||||
|
use \Entity\Station;
|
||||||
|
use \Entity\Schedule;
|
||||||
|
|
||||||
|
class Api_ScheduleController extends \PVL\Controller\Action\Api
|
||||||
|
{
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
if ($this->_hasParam('month'))
|
||||||
|
{
|
||||||
|
$show = $this->_getParam('month');
|
||||||
|
$calendar = new \DF\Calendar($show);
|
||||||
|
$timestamps = $calendar->getTimestamps();
|
||||||
|
|
||||||
|
$start_timestamp = $timestamps['start'];
|
||||||
|
$end_timestamp = $timestamps['end'];
|
||||||
|
}
|
||||||
|
elseif ($this->_hasParam('start'))
|
||||||
|
{
|
||||||
|
$start_timestamp = (int)$this->_getParam('start');
|
||||||
|
$end_timestamp = (int)$this->_getParam('end');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$start_timestamp = time();
|
||||||
|
$end_timestamp = time()+(86400 * 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
$station_shortcode = $this->_getParam('station', 'all');
|
||||||
|
$short_names = Station::getShortNameLookup();
|
||||||
|
|
||||||
|
if ($station_shortcode != "all")
|
||||||
|
{
|
||||||
|
$station = $short_names[$station_shortcode];
|
||||||
|
|
||||||
|
$events_raw = $this->em->createQuery('SELECT s FROM Entity\Schedule s WHERE (s.station_id = :sid) AND (s.start_time <= :end AND s.end_time >= :start) ORDER BY s.start_time ASC')
|
||||||
|
->setParameter('sid', $station['id'])
|
||||||
|
->setParameter('start', $start_timestamp)
|
||||||
|
->setParameter('end', $end_timestamp)
|
||||||
|
->getArrayResult();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$events_raw = $this->em->createQuery('SELECT s, st FROM Entity\Schedule s LEFT JOIN s.station st WHERE (s.start_time <= :end AND s.end_time >= :start) ORDER BY s.start_time ASC')
|
||||||
|
->setParameter('start', $start_timestamp)
|
||||||
|
->setParameter('end', $end_timestamp)
|
||||||
|
->getArrayResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
$events = array();
|
||||||
|
foreach((array)$events_raw as $event)
|
||||||
|
{
|
||||||
|
if ($station_shortcode == 'all')
|
||||||
|
{
|
||||||
|
$shortcode = Station::getStationShortName($event['station']['name']);
|
||||||
|
$event['station'] = $shortcode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unset($event['station']);
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($event['is_notified']);
|
||||||
|
|
||||||
|
$events[] = $event;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->returnSuccess($events);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function conventionsAction()
|
||||||
|
{
|
||||||
|
$start_timestamp = strtotime('-1 month');
|
||||||
|
$end_timestamp = strtotime('+1 year');
|
||||||
|
|
||||||
|
$events_raw = $this->em->createQuery('SELECT s FROM Entity\Schedule s WHERE s.type = :type AND s.start_time <= :end AND s.end_time >= :start ORDER BY s.start_time ASC')
|
||||||
|
->setParameter('type', 'convention')
|
||||||
|
->setParameter('start', $start_timestamp)
|
||||||
|
->setParameter('end', $end_timestamp)
|
||||||
|
->getArrayResult();
|
||||||
|
|
||||||
|
$events = array();
|
||||||
|
foreach((array)$events_raw as $event)
|
||||||
|
{
|
||||||
|
$special_info = \PVL\ScheduleManager::formatName($event['title']);
|
||||||
|
$event = array_merge($event, $special_info);
|
||||||
|
|
||||||
|
unset($event['station_id'], $event['icon'], $event['is_notified']);
|
||||||
|
|
||||||
|
$events[] = $event;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->returnSuccess($events);
|
||||||
|
}
|
||||||
|
}
|
18
app/modules/api/controllers/SongController.php
Normal file
18
app/modules/api/controllers/SongController.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
use \Entity\Song;
|
||||||
|
|
||||||
|
class Api_SongController extends \PVL\Controller\Action\Api
|
||||||
|
{
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
$id = $this->_getParam('id');
|
||||||
|
|
||||||
|
$record = Song::find($id);
|
||||||
|
|
||||||
|
if (!($record instanceof Song))
|
||||||
|
return $this->returnError('Song not found.');
|
||||||
|
|
||||||
|
$return = $record->toArray();
|
||||||
|
return $this->returnSuccess($return);
|
||||||
|
}
|
||||||
|
}
|
69
app/modules/api/controllers/StationController.php
Normal file
69
app/modules/api/controllers/StationController.php
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<?php
|
||||||
|
use \Entity\Station;
|
||||||
|
|
||||||
|
class Api_StationController extends \PVL\Controller\Action\Api
|
||||||
|
{
|
||||||
|
public function indexAction()
|
||||||
|
{
|
||||||
|
if ($this->_hasParam('station'))
|
||||||
|
{
|
||||||
|
$record = Station::findByShortCode($this->_getParam('station'));
|
||||||
|
}
|
||||||
|
elseif ($this->_hasParam('id'))
|
||||||
|
{
|
||||||
|
$id = (int)$this->_getParam('id');
|
||||||
|
$record = Station::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($record instanceof Station) || $record->deleted_at)
|
||||||
|
return $this->returnError('Station not found.');
|
||||||
|
|
||||||
|
return $this->returnSuccess($this->_processStation($record));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function listAction()
|
||||||
|
{
|
||||||
|
$category = $this->_getParam('category', 'all');
|
||||||
|
|
||||||
|
if ($category == 'all')
|
||||||
|
{
|
||||||
|
$stations_raw = Station::fetchArray();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cats = Station::getStationsInCategories();
|
||||||
|
|
||||||
|
if (!isset($cats[$category]))
|
||||||
|
return $this->returnError('Category not found.');
|
||||||
|
|
||||||
|
$stations_raw = $cats[$category]['stations'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$stations = array();
|
||||||
|
foreach($stations_raw as $row)
|
||||||
|
$stations[] = $this->_processStation($row);
|
||||||
|
|
||||||
|
return $this->returnSuccess($stations);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function _processStation($row)
|
||||||
|
{
|
||||||
|
if ($row instanceof Station)
|
||||||
|
$row = $row->toArray();
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'id' => (int)$row['id'],
|
||||||
|
'name' => $row['name'],
|
||||||
|
'shortcode' => Station::getStationShortName($row['name']),
|
||||||
|
'genre' => $row['genre'],
|
||||||
|
'category' => $row['category'],
|
||||||
|
'type' => $row['type'],
|
||||||
|
'image_url' => \DF\Url::content($row['image_url']),
|
||||||
|
'web_url' => $row['web_url'],
|
||||||
|
'stream_url' => $row['stream_url'],
|
||||||
|
'twitter_url' => $row['twitter_url'],
|
||||||
|
'irc' => $row['irc'],
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,6 +26,7 @@ class EventsController extends \DF\Controller\Action
|
||||||
$event['end_timestamp'] = $event['end_time'];
|
$event['end_timestamp'] = $event['end_time'];
|
||||||
|
|
||||||
$special_info = \PVL\ScheduleManager::formatName($event['title']);
|
$special_info = \PVL\ScheduleManager::formatName($event['title']);
|
||||||
|
|
||||||
$event['title'] = $special_info['title'];
|
$event['title'] = $special_info['title'];
|
||||||
$event['city'] = $special_info['city'];
|
$event['city'] = $special_info['city'];
|
||||||
$event['title_full'] = $special_info['title_full'];
|
$event['title_full'] = $special_info['title_full'];
|
||||||
|
|
|
@ -263,27 +263,6 @@ for($i = 0; $i <= $num_cols-1; $i++)
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
/*
|
|
||||||
<? if (!$this->special_event): ?>
|
|
||||||
$('a').not('.station').not('#btn-tune-in').on('click', function(e) {
|
|
||||||
var url = $(this).attr("href");
|
|
||||||
|
|
||||||
if(url.slice(0, 1) != "#")
|
|
||||||
{
|
|
||||||
var current_station = $('#tunein_player').data('current_station');
|
|
||||||
if (current_station)
|
|
||||||
playInPopUp('current');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
<? endif; ?>
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Web player link */
|
|
||||||
$('#btn-tune-in').click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
playInPopUp('current');
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.btn-play-station').click(function(e) {
|
$('.btn-play-station').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
@ -7,7 +7,7 @@ $this->headTitle('Ponyville Live!');
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="home_buttons">
|
<div id="home_buttons">
|
||||||
<a class="ui-btn ui-corner-all" href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'radio')) ?>">
|
<a class="ui-btn ui-corner-all" data-ajax="true" href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'radio')) ?>">
|
||||||
<i class="fa fa-music"></i> Radio Stations
|
<i class="fa fa-music"></i> Radio Stations
|
||||||
</a>
|
</a>
|
||||||
<a class="ui-btn ui-corner-all" href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'video')) ?>">
|
<a class="ui-btn ui-corner-all" href="<?=$this->route(array('module' => 'mobile', 'action' => 'view', 'type' => 'video')) ?>">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$('#btn-tunein').click(function(e) {
|
$('#btn-tune-in').click(function(e) {
|
||||||
var href = $(this).attr('href');
|
var href = $(this).attr('href');
|
||||||
window.open(href, "pvlplayer", "width=400,height=600,menubar=0,toolbar=0,location=0,status=1");
|
window.open(href, "pvlplayer", "width=400,height=600,menubar=0,toolbar=0,location=0,status=1");
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,13 @@
|
||||||
* Mobile Custom JS
|
* Mobile Custom JS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var pvl_player;
|
||||||
|
|
||||||
var is_playing = false;
|
var is_playing = false;
|
||||||
var is_first_load = true;
|
var is_first_load = true;
|
||||||
var volume = 100;
|
var volume = 100;
|
||||||
|
|
||||||
|
var nowplaying_data;
|
||||||
var nowplaying_last_run = 0;
|
var nowplaying_last_run = 0;
|
||||||
var nowplaying_timeout;
|
var nowplaying_timeout;
|
||||||
var nowplaying_interval;
|
var nowplaying_interval;
|
||||||
|
@ -15,18 +18,21 @@ $(document).on("pageinit", function() {
|
||||||
{
|
{
|
||||||
$('#btn_back').hide();
|
$('#btn_back').hide();
|
||||||
|
|
||||||
$("#pvl-jplayer").jPlayer({
|
if (!DF_IsApp)
|
||||||
swfPath: DF_ContentPath+'/jplayer/jplayer.swf',
|
{
|
||||||
solution: (canPlayMp3()) ? 'html, flash' : 'flash',
|
$("#pvl-jplayer").jPlayer({
|
||||||
supplied: 'mp3',
|
swfPath: DF_ContentPath+'/jplayer/jplayer.swf',
|
||||||
preload: 'none',
|
solution: (canPlayMp3()) ? 'html, flash' : 'flash',
|
||||||
volume: (volume / 100),
|
supplied: 'mp3',
|
||||||
muted: false,
|
preload: 'none',
|
||||||
backgroundColor: '#000000',
|
volume: (volume / 100),
|
||||||
cssSelectorAncestor: '#pvl-jplayer-controls',
|
muted: false,
|
||||||
errorAlerts: false,
|
backgroundColor: '#000000',
|
||||||
warningAlerts: false
|
cssSelectorAncestor: '#pvl-jplayer-controls',
|
||||||
});
|
errorAlerts: false,
|
||||||
|
warningAlerts: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#player_controls').hide();
|
$('#player_controls').hide();
|
||||||
|
|
||||||
|
@ -34,11 +40,10 @@ $(document).on("pageinit", function() {
|
||||||
$('#player_volume').slider({
|
$('#player_volume').slider({
|
||||||
stop: function(event, ui) {
|
stop: function(event, ui) {
|
||||||
volume = parseInt(event.target.value);
|
volume = parseInt(event.target.value);
|
||||||
|
playerSetVolume(volume);
|
||||||
if (is_playing)
|
|
||||||
$('#pvl-jplayer').jPlayer('volume', (volume / 100));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#player_controls #player_pause').on("click", function(event, ui) {
|
$('#player_controls #player_pause').on("click", function(event, ui) {
|
||||||
stopAllPlayers();
|
stopAllPlayers();
|
||||||
});
|
});
|
||||||
|
@ -79,8 +84,8 @@ $(window).on("pagecontainershow", function(event) {
|
||||||
$(this).addClass("ui-btn-active");
|
$(this).addClass("ui-btn-active");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Detect autoplay station.
|
// Force a reload (or re-print) of now playing data.
|
||||||
checkNowPlaying(true);
|
checkNowPlaying();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure now-playing is being checked, in spite of any interruptions.
|
// Ensure now-playing is being checked, in spite of any interruptions.
|
||||||
|
@ -98,111 +103,119 @@ function checkNowPlaying(force_update)
|
||||||
// Only run now-playing once every 10 seconds max.
|
// Only run now-playing once every 10 seconds max.
|
||||||
var current_timestamp = getUnixTimestamp();
|
var current_timestamp = getUnixTimestamp();
|
||||||
if (current_timestamp - nowplaying_last_run < 10 && !force_update)
|
if (current_timestamp - nowplaying_last_run < 10 && !force_update)
|
||||||
|
{
|
||||||
|
processNowPlaying();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
jQuery.ajax({
|
||||||
|
cache: false,
|
||||||
|
url: DF_ContentPath+'/api/nowplaying.json',
|
||||||
|
dataType: 'json'
|
||||||
|
}).done(function(data) {
|
||||||
|
nowplaying_data = data;
|
||||||
|
processNowPlaying();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function processNowPlaying()
|
||||||
|
{
|
||||||
|
if (typeof nowplaying_data === 'undefined')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nowplaying_last_run = getUnixTimestamp();
|
for (var station_id in nowplaying_data)
|
||||||
|
{
|
||||||
|
var station_info = nowplaying_data[station_id];
|
||||||
|
var station = $('[data-role="page"].ui-page-active #station_'+station_id);
|
||||||
|
var station_exists = (station.length != 0);
|
||||||
|
|
||||||
jQuery.ajax({
|
if (station_exists)
|
||||||
cache: false,
|
|
||||||
url: DF_ContentPath+'/api/nowplaying.json',
|
|
||||||
dataType: 'json'
|
|
||||||
}).done(function(data) {
|
|
||||||
var listener_total = 0;
|
|
||||||
var listeners_by_type = new Array();
|
|
||||||
|
|
||||||
for (var station_id in data)
|
|
||||||
{
|
{
|
||||||
var station_info = data[station_id];
|
// Format title.
|
||||||
var station = $('[data-role="page"].ui-page-active #station_'+station_id);
|
if (!station_info.title)
|
||||||
var station_exists = (station.length != 0);
|
|
||||||
|
|
||||||
if (station_exists)
|
|
||||||
{
|
{
|
||||||
// Format title.
|
station.find('.nowplaying-artist').text(station_info.text);
|
||||||
if (!station_info.title)
|
station.find('.nowplaying-title').text('');
|
||||||
{
|
}
|
||||||
station.find('.nowplaying-artist').text(station_info.text);
|
else
|
||||||
station.find('.nowplaying-title').text('');
|
{
|
||||||
}
|
station.find('.nowplaying-artist').text(station_info.title);
|
||||||
else
|
station.find('.nowplaying-title').text(station_info.artist);
|
||||||
{
|
|
||||||
station.find('.nowplaying-artist').text(station_info.title);
|
|
||||||
station.find('.nowplaying-title').text(station_info.artist);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Post listener count.
|
|
||||||
if (station_info.listeners)
|
|
||||||
station.find('.nowplaying-listeners').show().html('<i class="fa fa-user"></i> '+station_info.listeners);
|
|
||||||
else
|
|
||||||
station.find('.nowplaying-listeners').hide();
|
|
||||||
|
|
||||||
// Set station "live" status or "offline" status.
|
|
||||||
if (station_info.text == 'Stream Offline')
|
|
||||||
{
|
|
||||||
station.find('.nowplaying-live').hide();
|
|
||||||
station.removeClass('live').addClass('offline');
|
|
||||||
|
|
||||||
if (station.data('inactive') == 'hide')
|
|
||||||
station.hide();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
station.find('.nowplaying-live').hide();
|
|
||||||
station.removeClass('live offline');
|
|
||||||
|
|
||||||
if (!station.is(':visible'))
|
|
||||||
station.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set event data.
|
|
||||||
if (station_info.event)
|
|
||||||
{
|
|
||||||
var event_info = station_info.event;
|
|
||||||
station.find('.nowplaying-onair').show().find('.nowplaying-onair-inner').html('<i class="fa fa-star"></i> On Air: '+event_info.title);
|
|
||||||
}
|
|
||||||
else if (station_info.event_upcoming)
|
|
||||||
{
|
|
||||||
var event_info = station_info.event_upcoming;
|
|
||||||
station.find('.nowplaying-onair').show().find('.nowplaying-onair-inner').html('<i class="fa fa-star"></i> In '+event_info.minutes_until+' mins: '+event_info.title);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
station.find('.nowplaying-onair').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set station history.
|
|
||||||
if (station_info.song_history)
|
|
||||||
{
|
|
||||||
var history_block = '';
|
|
||||||
|
|
||||||
for (var j in station_info.song_history)
|
|
||||||
{
|
|
||||||
var song_num = parseInt(j)+1;
|
|
||||||
var history_row = station_info.song_history[j];
|
|
||||||
|
|
||||||
history_block += '<div>#'+song_num+": "+history_row.text+'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
station.find('.station-history').html(history_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (station_info.song_id)
|
|
||||||
{
|
|
||||||
// Detect a change in song.
|
|
||||||
var current_song_id = station.data('song_id');
|
|
||||||
if (station_info.song_id != current_song_id)
|
|
||||||
{
|
|
||||||
station.find('.btn-like').removeClass('btn-disabled').addClass('btn-success');
|
|
||||||
}
|
|
||||||
|
|
||||||
station.data('song_id', station_info.song_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
nowplaying_timeout = setTimeout('checkNowPlaying()', 20000);
|
// Post listener count.
|
||||||
});
|
if (station_info.listeners)
|
||||||
|
station.find('.nowplaying-listeners').show().html('<i class="fa fa-user"></i> '+station_info.listeners);
|
||||||
|
else
|
||||||
|
station.find('.nowplaying-listeners').hide();
|
||||||
|
|
||||||
|
// Set station "live" status or "offline" status.
|
||||||
|
if (station_info.text == 'Stream Offline')
|
||||||
|
{
|
||||||
|
station.find('.nowplaying-live').hide();
|
||||||
|
station.removeClass('live').addClass('offline');
|
||||||
|
|
||||||
|
if (station.data('inactive') == 'hide')
|
||||||
|
station.hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
station.find('.nowplaying-live').hide();
|
||||||
|
station.removeClass('live offline');
|
||||||
|
|
||||||
|
if (!station.is(':visible'))
|
||||||
|
station.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set event data.
|
||||||
|
if (station_info.event)
|
||||||
|
{
|
||||||
|
var event_info = station_info.event;
|
||||||
|
station.find('.nowplaying-onair').show().find('.nowplaying-onair-inner').html('<i class="fa fa-star"></i> On Air: '+event_info.title);
|
||||||
|
}
|
||||||
|
else if (station_info.event_upcoming)
|
||||||
|
{
|
||||||
|
var event_info = station_info.event_upcoming;
|
||||||
|
station.find('.nowplaying-onair').show().find('.nowplaying-onair-inner').html('<i class="fa fa-star"></i> In '+event_info.minutes_until+' mins: '+event_info.title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
station.find('.nowplaying-onair').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set station history.
|
||||||
|
if (station_info.song_history)
|
||||||
|
{
|
||||||
|
var history_block = '';
|
||||||
|
|
||||||
|
for (var j in station_info.song_history)
|
||||||
|
{
|
||||||
|
var song_num = parseInt(j)+1;
|
||||||
|
var history_row = station_info.song_history[j];
|
||||||
|
|
||||||
|
history_block += '<div>#'+song_num+": "+history_row.text+'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
station.find('.station-history').html(history_block);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (station_info.song_id)
|
||||||
|
{
|
||||||
|
// Detect a change in song.
|
||||||
|
var current_song_id = station.data('song_id');
|
||||||
|
if (station_info.song_id != current_song_id)
|
||||||
|
{
|
||||||
|
station.find('.btn-like').removeClass('btn-disabled').addClass('btn-success');
|
||||||
|
}
|
||||||
|
|
||||||
|
station.data('song_id', station_info.song_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nowplaying_timeout = setTimeout('checkNowPlaying()', 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function playStation(id)
|
function playStation(id)
|
||||||
|
@ -222,7 +235,10 @@ function playStation(id)
|
||||||
|
|
||||||
if (stream_type == "stream")
|
if (stream_type == "stream")
|
||||||
{
|
{
|
||||||
window.location.href = stream_url;
|
if (DF_IsApp)
|
||||||
|
window.open(stream_url);
|
||||||
|
else
|
||||||
|
window.location.href = stream_url;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -240,21 +256,42 @@ function playStation(id)
|
||||||
|
|
||||||
function startPlayer(stream_url)
|
function startPlayer(stream_url)
|
||||||
{
|
{
|
||||||
var stream = {
|
if (DF_IsApp)
|
||||||
title: "Ponyville Live!",
|
{
|
||||||
mp3: stream_url
|
pvl_player = new Media(stream_url, function() {
|
||||||
};
|
playerSetVolume(volume);
|
||||||
|
console.log("playAudio(): Audio Success");
|
||||||
|
},
|
||||||
|
function(err) {
|
||||||
|
console.log("playAudio(): Audio Error: "+err);
|
||||||
|
});
|
||||||
|
|
||||||
|
pvl_player.play();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var stream = {
|
||||||
|
title: "Ponyville Live!",
|
||||||
|
mp3: stream_url
|
||||||
|
};
|
||||||
|
$("#pvl-jplayer").jPlayer("setMedia", stream).jPlayer("play");
|
||||||
|
}
|
||||||
|
|
||||||
is_playing = true;
|
is_playing = true;
|
||||||
$('.btn_tunein').hide();
|
$('.btn_tunein').hide();
|
||||||
|
|
||||||
$("#pvl-jplayer").jPlayer("setMedia", stream).jPlayer("play");
|
|
||||||
$('#player_controls').show();
|
$('#player_controls').show();
|
||||||
|
$("[data-role='header'], [data-role='footer']").toolbar("updatePagePadding");
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopAllPlayers()
|
function stopAllPlayers()
|
||||||
{
|
{
|
||||||
if ($("#pvl-jplayer").length > 0)
|
if (DF_IsApp && typeof pvl_player !== 'undefined')
|
||||||
|
{
|
||||||
|
pvl_player.stop();
|
||||||
|
pvl_player.release();
|
||||||
|
}
|
||||||
|
else if ($("#pvl-jplayer").length > 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -275,6 +312,18 @@ function stopAllPlayers()
|
||||||
$('#player_controls').hide();
|
$('#player_controls').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function playerSetVolume(volume)
|
||||||
|
{
|
||||||
|
if (DF_IsApp)
|
||||||
|
{
|
||||||
|
pvl_player.setVolume(volume / 100);
|
||||||
|
}
|
||||||
|
else if (is_playing)
|
||||||
|
{
|
||||||
|
$('#pvl-jplayer').jPlayer('volume', (volume / 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function canPlayMp3()
|
function canPlayMp3()
|
||||||
{
|
{
|
||||||
if (isIE())
|
if (isIE())
|
||||||
|
|
6
web/static/mobile/mobile.css
Normal file
6
web/static/mobile/mobile.css
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
/**
|
||||||
|
* Mobile Bootstraper CSS
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import url('jquery.mobile-1.4.0.min.css');
|
||||||
|
@import url('custom.css');
|
BIN
web/static/rotators/tumblr_n1wy9554fn1s54imwo2_r1_1280.png
Normal file
BIN
web/static/rotators/tumblr_n1wy9554fn1s54imwo2_r1_1280.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 228 KiB |
BIN
web/static/rotators/tumblr_n1ysq2O8jL1s54imwo1_1280.png
Normal file
BIN
web/static/rotators/tumblr_n1ysq2O8jL1s54imwo1_1280.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
BIN
web/static/rotators/tumblr_n20ebakO0a1s54imwo1_1280.png
Normal file
BIN
web/static/rotators/tumblr_n20ebakO0a1s54imwo1_1280.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 491 KiB |
Binary file not shown.
Before Width: | Height: | Size: 88 KiB |
BIN
web/static/stations/20140306_091601_425_image_url_1.png
Normal file
BIN
web/static/stations/20140306_091601_425_image_url_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
BIN
web/static/stations/20140307_222133_346_image_url_1.png
Normal file
BIN
web/static/stations/20140307_222133_346_image_url_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
Loading…
Reference in New Issue
Block a user