38 lines
1.0 KiB
PHTML
38 lines
1.0 KiB
PHTML
<?php
|
|
/** @var App\Entity\Station $station */
|
|
|
|
$pageClasses = [];
|
|
$pageClasses[] = 'page-station-public-player-embed station-' . $station->getShortName();
|
|
$pageClasses[] = ($isSocial) ? 'embed-social' : 'embed';
|
|
|
|
$this->layout(
|
|
'minimal',
|
|
[
|
|
'page_class' => implode(' ', $pageClasses),
|
|
'title' => $this->e($station->getName()),
|
|
'hide_footer' => true,
|
|
]
|
|
);
|
|
|
|
$props = [
|
|
'initialNowPlaying' => $nowplaying,
|
|
'showAlbumArt' => !$customization->hideAlbumArt(),
|
|
'autoplay' => $autoplay,
|
|
];
|
|
|
|
if ($customization->useWebSocketsForNowPlaying()) {
|
|
$props['useNchan'] = true;
|
|
$props['nowPlayingUri'] = '/api/live/nowplaying/' . urlencode($station->getShortName());
|
|
} else {
|
|
$props['useNchan'] = false;
|
|
$props['nowPlayingUri'] = (string)$router->named('api:nowplaying:index', ['station_id' => $station->getId()]);
|
|
}
|
|
|
|
/** @var \App\Assets $assets */
|
|
$assets->addVueRender('Vue_PublicPlayer', '#station-nowplaying', $props);
|
|
?>
|
|
|
|
<div class="stations nowplaying">
|
|
<div id="station-nowplaying"></div>
|
|
</div>
|