I'm having trouble getting jPlayer to play tracks on iOS and Android devices. It does work on Windows Phone. I need to download a tracklist as JSON over AJAX call. Doing so, causes Android Chrome to cancel the GET request to the set track.
This is making my head hurt since it works on desktop & windows phone :-)
Below is a small snippet of the code with similar idea.
$('.container').on('click', '.start', function(){
$.ajax({
url: "json/jsondata.json",
dataType: "json",
type: "GET",
cache: true,
context: document.body
}).done(function(response){
// while-loop through response
// put track names in array etc...
var mp3file = trackarray[0];
App.$jmlPlayer.jPlayer("setMedia", {
mp3: mp3file
});
// This doesn't work on iOS / Android
$('.jmlPlayer').jPlayer("play");
});
});
$('.container').on('click', '.next', function(){
if(something){
var mp3file = trackarray[nextIdx];
App.$jmlPlayer.jPlayer("setMedia", {
mp3: mp3file
});
// This does work on iOS / Android
$('.jmlPlayer').jPlayer("play");
}
});