CC-1710FLAC, BWF, AAC support

-Enable browser preview for new filetypes
This commit is contained in:
Martin Konecny 2012-09-13 12:30:26 -04:00
parent fad6635a1a
commit 4fd9993108
1 changed files with 22 additions and 14 deletions

View File

@ -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);
} }