Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
denise 2012-09-12 16:29:35 -04:00
commit 32b1ee95b7
11 changed files with 129 additions and 56 deletions

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

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

View file

@ -378,10 +378,34 @@ var AIRTIME = (function(AIRTIME){
$pl.delegate(".spl_cue",
{"click": openCueEditor});
//add the play function to the play icon
$pl.delegate(".big_play",
{"click": openAudioPreview});
$.each($(".big_play"), function(index, value){
var mime = $(value).attr("data-mime-type");
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",
{"click": function(ev){
var id = parseInt($(this).attr("id").split("_").pop(), 10);