CC-3429: Firefox does not natively support mp3 file playing so preview does nothing.
- after reading about the trick foudn in Mark Panaghiston's posting from this link https://groups.google.com/forum/#!topic/jplayer/gTJrSCjwftw - the current imperfect solution for firefox sould be to show a video jplayer that can play all the audio types.
This commit is contained in:
parent
77e1c1c0cb
commit
7914b30233
|
@ -150,8 +150,11 @@ 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'){
|
||||||
$this->smartReadFile($filepath, 'audio/'.$ext);
|
$this->smartReadFile($filepath, 'audio/mpeg');
|
||||||
|
} else {
|
||||||
|
$this->smartReadFile($filepath, 'audio/'.$ext);
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}else{
|
}else{
|
||||||
header ("HTTP/1.1 404 Not Found");
|
header ("HTTP/1.1 404 Not Found");
|
||||||
|
|
|
@ -8,16 +8,22 @@ var _idToPostionLookUp;
|
||||||
*/
|
*/
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
if (useFlash())
|
||||||
|
mySupplied = "oga, mp3, m4v";
|
||||||
|
else
|
||||||
|
mySupplied = "oga, mp3";
|
||||||
|
|
||||||
_playlist_jplayer = new jPlayerPlaylist({
|
_playlist_jplayer = new jPlayerPlaylist({
|
||||||
jPlayer: "#jquery_jplayer_1",
|
jPlayer: "#jquery_jplayer_1",
|
||||||
cssSelectorAncestor: "#jp_container_1"
|
cssSelectorAncestor: "#jp_container_1"
|
||||||
},[], //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: "mp3,oga",
|
supplied:mySupplied,
|
||||||
wmode: "window"
|
wmode: "window"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$.jPlayer.timeFormat.showHour = true;
|
$.jPlayer.timeFormat.showHour = true;
|
||||||
|
|
||||||
var audioFileID = $('.audioFileID').text();
|
var audioFileID = $('.audioFileID').text();
|
||||||
|
@ -35,6 +41,10 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function useFlash() {
|
||||||
|
console.log(navigator.userAgent);
|
||||||
|
return navigator.userAgent.toLowerCase().match('firefox');
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Sets up the jPlayerPlaylist to play.
|
* Sets up the jPlayerPlaylist to play.
|
||||||
* - Get the playlist info based on the playlistID give.
|
* - Get the playlist info based on the playlistID give.
|
||||||
|
@ -122,7 +132,7 @@ 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 fileExtensioin = p_audioFileID.split('.').pop();
|
||||||
|
console.log(p_audioFileID);
|
||||||
if (fileExtensioin === '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():"",
|
||||||
|
@ -135,7 +145,7 @@ function playOne(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);
|
||||||
|
|
Loading…
Reference in New Issue