David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

javascript to play music not working on andriod

Hi,

Ive used the following support page to play music throughout my app.
https://getsatisfaction.com/apperyio/...

the app works great in browser test, apperyio test app and on ios. But when I export to android it doesn't play any any music (Ive debugged it and the code is running correctly)

the code is as follows

var onLoad = function() {
var audioText = 'source src="https://files/resources/image/XappY.mp3"/source';
var audio = jQuery(audioText);
jQuery("body").append(audio);
console.log("load m");
};

jQuery(window).bind("load", onLoad);

function PlayTrack(src) {
console.log("load music");
var au = jQuery("#yourAudio");
au.attr("src", src);
if (au[0] && au[0].play) au[0].play();
}

function StopPlayTrack() {
var au = jQuery("#yourAudio");
if (au[0] && au[0].play) au[0].pause();
}

Any help wold be great

thanks

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

javascript to play music not working on andriod

Hello David,

Could you please clarify have you changed any android permissions?

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

javascript to play music not working on andriod

Hi Evgene,
there still set to default and audio is enabled

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

javascript to play music not working on andriod

Hello David,

Please share your app with support, tell us its name and steps to reproduce the issue. Also please detail with what device with what os do you test it.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

javascript to play music not working on andriod

Thank you Evgene.
I've shared it with you, its called xappy. In browser test and ios the app plays music on loading. But ifyou export to Android the music doesn't play (its like it can't find the music file as the JavaScript is running correctly in debug(

Thank you

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

javascript to play music not working on andriod

Hi David,

Please tell us step-by step instruction to test this problem on Android device.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

javascript to play music not working on andriod

Hi Alena,

If you export the app to android and open the app the music doesnt play. It should start automatically.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

javascript to play music not working on andriod

Hi David,

Sorry for radio silence here, we were managed to reproduce it on device, we'll investigate it more and get back with update as soon as possible.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

javascript to play music not working on andriod

Hello David,

Please use audio component with property "Auto Play"

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

javascript to play music not working on andriod

Hi Sergiy,

If I used the component and "Auto Play" how would i add the option to turn the music on or off through a button command?

Return to “Issues”