i had setup the following and it works on Android devices, iPhone and Stimulator
but it does not work for Windows Phone device.
function playsound(filename) {
var media;
if (device.platform == "Android") {
media = new Media("/android_asset/www/media/" + filename + ".mp3");
} else {
media = new Media("media/"+ filename +".mp3");
}
media.play({ numberOfLoops: 1 });
};
Kindly advise on what I had missed out here.
Thanks in advance.
6 Answers, 1 is accepted
I am glad that you have solved your issue and thank you for sharing it with our community.
If you have any concerns please do not hesitate to share with us.
Regards,
Zdravko
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
I am using windows Phone 10, and the Audio(src).play() option does not seem to work?
Is this a known issue?
Could you please share if the Audio object is a Cordova Media one or you are following different approach for playing audio on the device? Also, as Windows 10 Mobile is still in early beta and Cordova does not officially supports it, we haven't done much testing there. This said, it is highly expected for such issues to be present.
Regards,
Kaloyan
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
Hi,
I tried different solutions.
new Media(src, ... And
audio = new Audio(src).play();
with src a local file
Works in emulator.
For now it isn't that important, so i'll wait till windows 10 gets released.
As a temporary solution i switch to a web audio file (http://...) instead.
Thanks so far
I am glad to see you have found a workaround to the issue. Also, thank you for sharing it with us and the AppBuilder community.
We will further investigate this on our side, once Windows 10 Mobile is released and Cordova publish an official support for it in the Media plugin.
Regards,
Kaloyan
Telerik
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.