CC-4765: Webstream of AAC type can't be previewed

-fixed
This commit is contained in:
Martin Konecny 2013-01-02 16:09:32 -05:00
parent cdb3ec468a
commit d6eb043899
3 changed files with 13 additions and 8 deletions

View File

@ -218,9 +218,11 @@ class LibraryController extends Zend_Controller_Action
}
$menu["duplicate"] = array("name" => _("Duplicate Playlist"), "icon" => "edit", "url" => $baseUrl."/library/duplicate");
} elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPK($id);
$obj = new Application_Model_Webstream($webstream);
$menu["play"]["mime"] = $webstream->getDbMime();
if (isset($obj_sess->id) && $screen == "playlist") {
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($obj_sess->type === "playlist") {

View File

@ -709,6 +709,11 @@ SQL;
$blSelect[] = "NULL::VARCHAR AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "url AS ".$key;
} else if ($key == "mime") {
$plSelect[] = "NULL::VARCHAR AS ".$key;
$blSelect[] = "NULL::VARCHAR AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = $key;
} else {
$plSelect[] = "NULL::text AS ".$key;
$blSelect[] = "NULL::text AS ".$key;

View File

@ -558,20 +558,18 @@ var AIRTIME = (function(AIRTIME) {
// add the play function to the library_type td
$(nRow).find('td.library_type').click(function(){
if (aData.ftype === 'playlist' && aData.length !== '0.0'){
playlistIndex = $(this).parent().attr('id').substring(3); // remove
// the
// pl_
playlistIndex = $(this).parent().attr('id').substring(3);
open_playlist_preview(playlistIndex, 0);
} else if (aData.ftype === 'audioclip') {
if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
}
} else if (aData.ftype == 'stream') {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
}
} else if (aData.ftype == 'block' && aData.bl_type == 'static') {
blockIndex = $(this).parent().attr('id').substring(3); // remove
// the
// bl_
blockIndex = $(this).parent().attr('id').substring(3);
open_block_preview(blockIndex, 0);
}
return false;