parent
d8a1a17f19
commit
22453f3820
|
@ -148,7 +148,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
//user clicks play button for track and downloads it.
|
//user clicks play button for track and downloads it.
|
||||||
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
|
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
|
||||||
}
|
}
|
||||||
if ($ext === 'mp3'){
|
if (strtolower($ext) === 'mp3'){
|
||||||
$this->smartReadFile($filepath, 'audio/mpeg');
|
$this->smartReadFile($filepath, 'audio/mpeg');
|
||||||
} else {
|
} else {
|
||||||
$this->smartReadFile($filepath, 'audio/'.$ext);
|
$this->smartReadFile($filepath, 'audio/'.$ext);
|
||||||
|
|
|
@ -106,9 +106,9 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
'element_position' => isset($track['position'])?$track['position']:"",
|
'element_position' => isset($track['position'])?$track['position']:"",
|
||||||
);
|
);
|
||||||
$fileExtension = pathinfo($track['CcFiles']['filepath'], PATHINFO_EXTENSION);
|
$fileExtension = pathinfo($track['CcFiles']['filepath'], PATHINFO_EXTENSION);
|
||||||
if ($fileExtension === 'mp3'){
|
if (strtolower($fileExtension) === 'mp3'){
|
||||||
$elementMap['element_mp3'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
$elementMap['element_mp3'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
||||||
} else if( $fileExtension === 'ogg') {
|
} else if(strtolower($fileExtension) === 'ogg') {
|
||||||
$elementMap['element_oga'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
$elementMap['element_oga'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
||||||
} else {
|
} else {
|
||||||
//the media was neither mp3 or ogg
|
//the media was neither mp3 or ogg
|
||||||
|
@ -181,9 +181,9 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
);
|
);
|
||||||
|
|
||||||
$fileExtension = pathinfo($track['filepath'], PATHINFO_EXTENSION);
|
$fileExtension = pathinfo($track['filepath'], PATHINFO_EXTENSION);
|
||||||
if ($fileExtension === 'mp3'){
|
if (strtolower($fileExtension) === 'mp3'){
|
||||||
$elementMap['element_mp3'] = $track['gunid'].'.'.$fileExtension;
|
$elementMap['element_mp3'] = $track['gunid'].'.'.$fileExtension;
|
||||||
} else if( $fileExtension === 'ogg') {
|
} else if(strtolower($fileExtension) === 'ogg') {
|
||||||
$elementMap['element_oga'] = $track['gunid'].'.'.$fileExtension;
|
$elementMap['element_oga'] = $track['gunid'].'.'.$fileExtension;
|
||||||
} else {
|
} else {
|
||||||
//the media was neither mp3 or ogg
|
//the media was neither mp3 or ogg
|
||||||
|
|
|
@ -166,25 +166,23 @@ function play(p_playlistIndex){
|
||||||
*/
|
*/
|
||||||
function playOne(p_audioFileID) {
|
function playOne(p_audioFileID) {
|
||||||
var playlist = new Array();
|
var playlist = new Array();
|
||||||
var fileExtensioin = p_audioFileID.split('.').pop();
|
var fileExtension = p_audioFileID.split('.').pop();
|
||||||
console.log(p_audioFileID);
|
if (fileExtension.toLowerCase() === 'mp3') {
|
||||||
if (fileExtensioin === 'mp3') {
|
|
||||||
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():"",
|
||||||
mp3:"/api/get-media/file/"+p_audioFileID
|
mp3:"/api/get-media/file/"+p_audioFileID
|
||||||
};
|
};
|
||||||
}else if (fileExtensioin === 'ogg' ) {
|
}else if (fileExtension.toLowerCase() === 'ogg' ) {
|
||||||
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:"/api/get-media/file/"+p_audioFileID
|
oga:"/api/get-media/file/"+p_audioFileID
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
_playlist_jplayer.option("autoPlay", true);
|
_playlist_jplayer.option("autoPlay", true);
|
||||||
console.log(media);
|
|
||||||
playlist[0] = media;
|
playlist[0] = media;
|
||||||
//_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready
|
//_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready
|
||||||
_playlist_jplayer._initPlaylist(playlist);
|
_playlist_jplayer._initPlaylist(playlist);
|
||||||
_playlist_jplayer.play(0);
|
_playlist_jplayer.play(0);
|
||||||
|
|
||||||
window.resizeTo(490, 167);
|
window.resizeTo(490, 167);
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ class MediaMonitorCommon:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
#will be in the format .ext
|
#will be in the format .ext
|
||||||
file_ext = os.path.splitext(original_path)[1]
|
file_ext = os.path.splitext(original_path)[1].lower()
|
||||||
path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE', 'MDATA_KEY_TRACKNUMBER', 'MDATA_KEY_BITRATE']
|
path_md = ['MDATA_KEY_TITLE', 'MDATA_KEY_CREATOR', 'MDATA_KEY_SOURCE', 'MDATA_KEY_TRACKNUMBER', 'MDATA_KEY_BITRATE']
|
||||||
|
|
||||||
md = {}
|
md = {}
|
||||||
|
|
Loading…
Reference in New Issue