Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
e984faf394
|
@ -14,7 +14,7 @@ $(document).ready(function(){
|
||||||
},[], //array of songs will be filled with below's json call
|
},[], //array of songs will be filled with below's json call
|
||||||
{
|
{
|
||||||
swfPath: "/js/jplayer",
|
swfPath: "/js/jplayer",
|
||||||
supplied:"oga, mp3, m4v",
|
supplied:"oga, mp3, m4v, m4a, wav",
|
||||||
size: {
|
size: {
|
||||||
width: "0px",
|
width: "0px",
|
||||||
height: "0px",
|
height: "0px",
|
||||||
|
@ -37,7 +37,6 @@ $(document).ready(function(){
|
||||||
|
|
||||||
var audioUri = $('.audioUri').text();
|
var audioUri = $('.audioUri').text();
|
||||||
var audioMime = $('.audioMime').text();
|
var audioMime = $('.audioMime').text();
|
||||||
//var audioFileID = $('.audioFileID').text();
|
|
||||||
var playlistID = $('.playlistID').text();
|
var playlistID = $('.playlistID').text();
|
||||||
var playlistIndex = $('.playlistIndex').text();
|
var playlistIndex = $('.playlistIndex').text();
|
||||||
var showID = $('.showID').text();
|
var showID = $('.showID').text();
|
||||||
|
@ -191,23 +190,32 @@ function play(p_playlistIndex){
|
||||||
*/
|
*/
|
||||||
function playOne(uri, mime) {
|
function playOne(uri, mime) {
|
||||||
var playlist = new Array();
|
var playlist = new Array();
|
||||||
|
|
||||||
|
var media = null;
|
||||||
|
var key = null;
|
||||||
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
|
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
|
||||||
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
|
key = "mp3";
|
||||||
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
|
|
||||||
mp3:uri
|
|
||||||
};
|
|
||||||
} else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) {
|
} else if (mime.search(/og(g|a)/i) > 0 || mime.search(/vorbis/i) > 0) {
|
||||||
|
key = "oga";
|
||||||
|
} else if (mime.search(/mp4/i) > 0) {
|
||||||
|
key = "m4a";
|
||||||
|
} else if (mime.search(/wav/i) > 0) {
|
||||||
|
key = "wav";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key) {
|
||||||
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
||||||
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
|
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():""
|
||||||
oga:uri
|
};
|
||||||
};
|
media[key] = uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
_playlist_jplayer.option("autoPlay", true);
|
if (media) {
|
||||||
playlist[0] = media;
|
_playlist_jplayer.option("autoPlay", true);
|
||||||
_playlist_jplayer._initPlaylist(playlist);
|
playlist[0] = media;
|
||||||
_playlist_jplayer.play(0);
|
_playlist_jplayer._initPlaylist(playlist);
|
||||||
|
_playlist_jplayer.play(0);
|
||||||
|
}
|
||||||
|
|
||||||
window.resizeTo(490, 167);
|
window.resizeTo(490, 167);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,8 @@ function isAudioSupported(mime){
|
||||||
var bMime = null;
|
var bMime = null;
|
||||||
if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) {
|
if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) {
|
||||||
bMime = 'audio/ogg; codecs="vorbis"';
|
bMime = 'audio/ogg; codecs="vorbis"';
|
||||||
} else if (mime.indexOf("mp3") != -1) {
|
} else {
|
||||||
bMime = "audio/mp3";
|
bMime = mime;
|
||||||
} else if (mime.indexOf("mp4") != -1) {
|
|
||||||
bMime = "audio/mp4";
|
|
||||||
} else if (mime.indexOf("flac") != -1) {
|
|
||||||
bMime = "audio/x-flac";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!bMime && !!audio.canPlayType && audio.canPlayType(bMime) != "";
|
return !!bMime && !!audio.canPlayType && audio.canPlayType(bMime) != "";
|
||||||
|
|
Loading…
Reference in New Issue