Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x
This commit is contained in:
commit
e41145b54e
3 changed files with 39 additions and 5 deletions
|
@ -21,7 +21,7 @@ if ($item['type'] == 2) {
|
||||||
<span class="ui-icon ui-icon-play"></span>
|
<span class="ui-icon ui-icon-play"></span>
|
||||||
</div>
|
</div>
|
||||||
<?php elseif ($item['type'] == 2 && $item['exists']): ?>
|
<?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>
|
<span class="ui-icon ui-icon-play"></span>
|
||||||
</div>
|
</div>
|
||||||
<?php else:?>
|
<?php else:?>
|
||||||
|
|
|
@ -123,6 +123,7 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
var media;
|
var media;
|
||||||
var index;
|
var index;
|
||||||
var total = 0;
|
var total = 0;
|
||||||
|
var skipped = 0;
|
||||||
for(index in data) {
|
for(index in data) {
|
||||||
if (data[index]['type'] == 0) {
|
if (data[index]['type'] == 0) {
|
||||||
if (data[index]['element_mp3'] != undefined){
|
if (data[index]['element_mp3'] != undefined){
|
||||||
|
@ -145,22 +146,30 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
artist: data[index]['element_artist'],
|
artist: data[index]['element_artist'],
|
||||||
wav:data[index]['uri']
|
wav:data[index]['uri']
|
||||||
};
|
};
|
||||||
}
|
} else {
|
||||||
|
// skip this track since it's not supported
|
||||||
|
console.log("continue");
|
||||||
|
skipped++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else if (data[index]['type'] == 1) {
|
} else if (data[index]['type'] == 1) {
|
||||||
media = {title: data[index]['element_title'],
|
media = {title: data[index]['element_title'],
|
||||||
artist: data[index]['element_artist'],
|
artist: data[index]['element_artist'],
|
||||||
mp3:data[index]['uri']
|
mp3:data[index]['uri']
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
console.log(data[index]);
|
||||||
if (media && isAudioSupported(data[index]['mime'])) {
|
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
|
// we should create a map according to the new position in the
|
||||||
// player itself total is the index on the player
|
// player itself total is the index on the player
|
||||||
_idToPostionLookUp[data[index]['element_id']] = total;
|
_idToPostionLookUp[data[index]['element_id']] = total;
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
|
|
||||||
_playlist_jplayer.setPlaylist(myPlaylist);
|
_playlist_jplayer.setPlaylist(myPlaylist);
|
||||||
_playlist_jplayer.option("autoPlay", true);
|
_playlist_jplayer.option("autoPlay", true);
|
||||||
play(p_playIndex);
|
play(p_playIndex);
|
||||||
|
|
|
@ -366,7 +366,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
//and verify whether they can be previewed by the browser or not. If not
|
//and verify whether they can be previewed by the browser or not. If not
|
||||||
//then the playlist element is greyed out
|
//then the playlist element is greyed out
|
||||||
mod.validatePlaylistElements = function(){
|
mod.validatePlaylistElements = function(){
|
||||||
$.each($(".big_play ui-icon-play"), function(index, value){
|
$.each($("div .big_play"), function(index, value){
|
||||||
if ($(value).attr('blockId') === undefined) {
|
if ($(value).attr('blockId') === undefined) {
|
||||||
var mime = $(value).attr("data-mime-type");
|
var mime = $(value).attr("data-mime-type");
|
||||||
if (isAudioSupported(mime)) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue