CC-6140: M3U streaming link
This commit is contained in:
parent
6cbc2f5316
commit
4d1d96c8f7
|
@ -24,7 +24,8 @@ class ApiController extends Zend_Controller_Action
|
||||||
"show-tracks",
|
"show-tracks",
|
||||||
"show-schedules",
|
"show-schedules",
|
||||||
"station-logo",
|
"station-logo",
|
||||||
"show-logo"
|
"show-logo",
|
||||||
|
"stream-m3u"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Zend_Session::isStarted()) {
|
if (Zend_Session::isStarted()) {
|
||||||
|
@ -1502,4 +1503,22 @@ class ApiController extends Zend_Controller_Action
|
||||||
$this->_helper->json->sendJson($hint);
|
$this->_helper->json->sendJson($hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function streamM3uAction()
|
||||||
|
{
|
||||||
|
$this->view->layout()->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
|
||||||
|
header('Content-Type: application/x-mpegurl');
|
||||||
|
header('Content-Disposition: attachment; filename=stream.m3u');
|
||||||
|
$m3uFile = "#EXTM3U\n\n";
|
||||||
|
|
||||||
|
$stationName = Application_Model_Preference::GetStationName();
|
||||||
|
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
|
||||||
|
|
||||||
|
foreach ($streamData as $stream) {
|
||||||
|
$m3uFile .= "#EXTINF,".$stationName." - " . strtoupper($stream['codec']) . "\n";
|
||||||
|
$m3uFile .= $stream['url'] . "\n\n";
|
||||||
|
}
|
||||||
|
echo $m3uFile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue