Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x

This commit is contained in:
denise 2012-10-16 14:33:56 -04:00
commit e41145b54e
3 changed files with 39 additions and 5 deletions
airtime_mvc
application/views/scripts/playlist
public/js/airtime
audiopreview
library

View File

@ -21,7 +21,7 @@ if ($item['type'] == 2) {
<span class="ui-icon ui-icon-play"></span>
</div>
<?php elseif ($item['type'] == 2 && $item['exists']): ?>
<div class="big_play" blockId="<?php echo $item["item_id"]; ?>">
<div class="big_play" blockId="<?php echo $item["item_id"]; ?>" blocktype="<?php echo $staticBlock?"static":"dynamic"?>">
<span class="ui-icon ui-icon-play"></span>
</div>
<?php else:?>

View File

@ -123,6 +123,7 @@ function buildplaylist(p_url, p_playIndex) {
var media;
var index;
var total = 0;
var skipped = 0;
for(index in data) {
if (data[index]['type'] == 0) {
if (data[index]['element_mp3'] != undefined){
@ -145,22 +146,30 @@ function buildplaylist(p_url, p_playIndex) {
artist: data[index]['element_artist'],
wav:data[index]['uri']
};
}
} else {
// skip this track since it's not supported
console.log("continue");
skipped++;
continue;
}
} else if (data[index]['type'] == 1) {
media = {title: data[index]['element_title'],
artist: data[index]['element_artist'],
mp3:data[index]['uri']
};
}
console.log(data[index]);
if (media && isAudioSupported(data[index]['mime'])) {
myPlaylist[index] = media;
// javascript doesn't support associative array with numeric key
// so we need to remove the gap if we skip any of tracks due to
// browser incompatibility.
myPlaylist[index-skipped] = media;
}
// we should create a map according to the new position in the
// player itself total is the index on the player
_idToPostionLookUp[data[index]['element_id']] = total;
total++;
}
_playlist_jplayer.setPlaylist(myPlaylist);
_playlist_jplayer.option("autoPlay", true);
play(p_playIndex);

View File

@ -366,7 +366,7 @@ var AIRTIME = (function(AIRTIME){
//and verify whether they can be previewed by the browser or not. If not
//then the playlist element is greyed out
mod.validatePlaylistElements = function(){
$.each($(".big_play ui-icon-play"), function(index, value){
$.each($("div .big_play"), function(index, value){
if ($(value).attr('blockId') === undefined) {
var mime = $(value).attr("data-mime-type");
if (isAudioSupported(mime)) {
@ -393,6 +393,31 @@ var AIRTIME = (function(AIRTIME){
},
})
}
} else {
if ($(value).attr('blocktype') === 'dynamic') {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
content: 'Dynamic block is not previewable',
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"
},
})
} else {
$(value).bind("click", openAudioPreview);
}
}
});
}