CC-1665: Scheduled stream rebroadcasting and recording

-capture stream mime type and store in db.
This commit is contained in:
Martin Konecny 2012-08-10 00:57:03 -04:00
parent 8eea34dc39
commit fe3f4ea678
10 changed files with 158 additions and 42 deletions

View file

@ -132,29 +132,19 @@ class ApiController extends Zend_Controller_Action
$file_base_name = substr($file_base_name, 1);
}
// possibly use fileinfo module here in the future.
// http://www.php.net/manual/en/book.fileinfo.php
$ext = pathinfo($file_base_name, PATHINFO_EXTENSION);
//Download user left clicks a track and selects Download.
if ("true" == $this->_getParam('download')) {
//path_info breaks up a file path into seperate pieces of informaiton.
//We just want the basename which is the file name with the path
//information stripped away. We are using Content-Disposition to specify
//to the browser what name the file should be saved as.
//
// By james.moon:
// I'm removing pathinfo() since it strips away UTF-8 characters.
// Using manualy parsing
header('Content-Disposition: attachment; filename="'.$file_base_name.'"');
} else {
//user clicks play button for track and downloads it.
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
}
if (strtolower($ext) === 'mp3') {
$this->smartReadFile($filepath, 'audio/mpeg');
} else {
$this->smartReadFile($filepath, 'audio/'.$ext);
}
$this->smartReadFile($filepath, $media->getPropelOrm()->getDbMime());
exit;
} else {
header ("HTTP/1.1 404 Not Found");