CC-4393: Please ignore AAC and Flac items for Playlist Preview and disable to preview it as a single track

-initial commit
This commit is contained in:
Martin Konecny 2012-09-12 15:43:50 -04:00
parent c61f5d1972
commit a418f5777c
9 changed files with 82 additions and 11 deletions

View File

@ -76,6 +76,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/audioplaytest.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if (!is_null($user)){ if (!is_null($user)){
@ -85,6 +86,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
} }
$view->headScript()->appendScript("var userType = '$userType';"); $view->headScript()->appendScript("var userType = '$userType';");
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
$view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
} }

View File

@ -193,7 +193,7 @@ class Application_Model_Block implements Application_Model_LibraryEditable
$files = array(); $files = array();
$sql = <<<"EOT" $sql = <<<"EOT"
SELECT pc.id as id, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, bl.type, f.length as orig_length, SELECT pc.id as id, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, bl.type, f.length as orig_length,
f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_blockcontents AS pc f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path, f.mime as mime FROM cc_blockcontents AS pc
LEFT JOIN cc_files AS f ON pc.file_id=f.id LEFT JOIN cc_files AS f ON pc.file_id=f.id
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
WHERE pc.block_id = :block_id WHERE pc.block_id = :block_id

View File

@ -172,7 +172,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
f.artist_name AS creator, f.artist_name AS creator,
f.file_exists AS EXISTS, f.file_exists AS EXISTS,
f.filepath AS path, f.filepath AS path,
f.length AS orig_length f.length AS orig_length,
f.mime AS mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_files AS f ON pc.file_id=f.id JOIN cc_files AS f ON pc.file_id=f.id
WHERE pc.playlist_id = :playlist_id1 WHERE pc.playlist_id = :playlist_id1
@ -190,7 +191,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
sub.login AS creator, sub.login AS creator,
't'::boolean AS EXISTS, 't'::boolean AS EXISTS,
ws.url AS path, ws.url AS path,
ws.length AS orig_length ws.length AS orig_length,
ws.mime as mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_webstream AS ws ON pc.stream_id=ws.id JOIN cc_webstream AS ws ON pc.stream_id=ws.id
LEFT JOIN cc_subjs AS sub ON sub.id = ws.creator_id LEFT JOIN cc_subjs AS sub ON sub.id = ws.creator_id
@ -209,7 +211,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
sbj.login AS creator, sbj.login AS creator,
't'::boolean AS EXISTS, 't'::boolean AS EXISTS,
NULL::text AS path, NULL::text AS path,
bl.length AS orig_length bl.length AS orig_length,
NULL::text as mime
FROM cc_playlistcontents AS pc FROM cc_playlistcontents AS pc
JOIN cc_block AS bl ON pc.block_id=bl.id JOIN cc_block AS bl ON pc.block_id=bl.id
JOIN cc_subjs AS sbj ON bl.creator_id=sbj.id JOIN cc_subjs AS sbj ON bl.creator_id=sbj.id

View File

@ -13,7 +13,7 @@ if ($item['type'] == 2) {
<div class="list-item-container"> <div class="list-item-container">
<?php if ($item['type'] == 0 && $item['exists']):?> <?php if ($item['type'] == 0 && $item['exists']):?>
<div class="big_play" audioFile="<?php echo $item["id"]; ?>"> <div class="big_play" audioFile="<?php echo $item["id"]; ?>" data-mime-type="<?php echo $item["mime"]; ?>">
<span class="ui-icon ui-icon-play"></span> <span class="ui-icon ui-icon-play"></span>
</div> </div>
<?php elseif ($item['type'] == 1 && $item['exists']): ?> <?php elseif ($item['type'] == 1 && $item['exists']): ?>

View File

@ -114,7 +114,6 @@
} }
.ui-icon-closethick, .ui-icon-closethick,
.ui-icon-play,
.spl_fade_control, .spl_fade_control,
.spl_text_input { .spl_text_input {
cursor: pointer; cursor: pointer;
@ -164,15 +163,31 @@
background: -moz-linear-gradient(top, #707070 0, #666666 100%); background: -moz-linear-gradient(top, #707070 0, #666666 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666));
} }
#spl_sortable div.big_play_disabled {
display:block;
width:20px;
height:50px;
margin:2px 0 0 2px;
text-align:center;
border:1px solid #5b5b5b;
float:left;
background-color: #707070;
background: -moz-linear-gradient(top, #707070 0, #666666 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #707070), color-stop(100%, #666666));
}
#spl_sortable div.big_play:hover { #spl_sortable div.big_play:hover {
border:1px solid #282828; border:1px solid #282828;
background-color: #3b3b3b; background-color: #3b3b3b;
background: -moz-linear-gradient(top, #3b3b3b 0, #292929 100%); background: -moz-linear-gradient(top, #3b3b3b 0, #292929 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3b3b3b), color-stop(100%, #292929)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3b3b3b), color-stop(100%, #292929));
cursor: pointer;
} }
#spl_sortable div.big_play .ui-icon { #spl_sortable div.big_play .ui-icon {
margin: 17px 0 0 1px; margin: 17px 0 0 1px;
} }
#spl_sortable div.big_play_disabled .ui-icon {
margin: 17px 0 0 1px;
}
#spl_sortable div.big_play:hover .ui-icon-play, #spl_sortable div.big_play:hover .ui-icon-pause { #spl_sortable div.big_play:hover .ui-icon-play, #spl_sortable div.big_play:hover .ui-icon-pause {
background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png); background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png);

View File

@ -2888,3 +2888,19 @@ dd .stream-status {
outline: 0; outline: 0;
border-top-color:#333333 border-top-color:#333333
} }
.dark_class
{
background-color: black;
filter:alpha(opacity=20); /* IE */
opacity: 0.2; /* Safari, Opera */
-moz-opacity:0.20; /* FireFox */
z-index: 20;
height: 100%;
width: 100%;
background-repeat:no-repeat;
background-position:center;
/* position:absolute; */
top: 0px;
left: 0px;
}

View File

@ -0,0 +1,10 @@
var audio = new Audio();
supportedAudio = {};
supportedAudio["audio/ogg"] = !!audio.canPlayType && audio.canPlayType('audio/ogg; codecs="vorbis"') != "";
supportedAudio["audio/mp3"] = !!audio.canPlayType && audio.canPlayType('audio/mp3') != "";
supportedAudio["audio/mp4"] = !!audio.canPlayType && audio.canPlayType('audio/mp4') != "";
supportedAudio["audio/x-flac"] = !!audio.canPlayType && audio.canPlayType('audio/x-flac') != "";
function isAudioSupported(mime){
return mime in supportedAudio && supportedAudio[mime];
}

View File

@ -917,7 +917,7 @@ function addQtipToSCIcons(){
else if($(this).hasClass("soundcloud")){ else if($(this).hasClass("soundcloud")){
$(this).qtip({ $(this).qtip({
content: { content: {
text: "Retreiving data from the server...", text: "Retrieving data from the server...",
ajax: { ajax: {
url: "/Library/get-upload-to-soundcloud-status", url: "/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",

View File

@ -378,10 +378,34 @@ var AIRTIME = (function(AIRTIME){
$pl.delegate(".spl_cue", $pl.delegate(".spl_cue",
{"click": openCueEditor}); {"click": openCueEditor});
//add the play function to the play icon $.each($(".big_play"), function(index, value){
$pl.delegate(".big_play", var mime = $(value).attr("data-mime-type");
{"click": openAudioPreview}); if (isAudioSupported(mime)) {
$(value).bind("click", openAudioPreview);
} else {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
content: 'Your browser does not support playing this file type: "'+ mime +'"',
show: 'mouseover',
hide: {
delay: 500,
fixed: true
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
},
position: {
my: "left bottom",
at: "right center"
},
})
}
});
$pl.delegate(".spl_block_expand", $pl.delegate(".spl_block_expand",
{"click": function(ev){ {"click": function(ev){
var id = parseInt($(this).attr("id").split("_").pop(), 10); var id = parseInt($(this).attr("id").split("_").pop(), 10);