This is a migrated thread and some comments may be shown as answers.

audio not playing

6 Answers 77 Views
Windows Phone
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jon
Top achievements
Rank 1
jon asked on 31 Jul 2014, 09:25 AM
Hi,

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

Sort by
0
jon
Top achievements
Rank 1
answered on 03 Aug 2014, 03:09 AM
i fixed it by using new Audio(src).play() instead for Windows Phone
0
Zdravko
Telerik team
answered on 04 Aug 2014, 03:15 PM
Hi Jon,

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.

 
0
ABECON Groep BV
Top achievements
Rank 1
answered on 02 Sep 2015, 11:26 AM

I am using windows Phone 10, and the Audio(src).play() option does not seem to work?

Is this a known issue?

0
Kaloyan
Telerik team
answered on 07 Sep 2015, 08:55 AM
Hello ABECON Groep BV,

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.

 
0
ABECON Groep BV
Top achievements
Rank 1
answered on 25 Sep 2015, 05:58 PM

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

 

 

 

0
Kaloyan
Telerik team
answered on 30 Sep 2015, 11:34 AM
Hi ABECON Groep BV,

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.

 
Tags
Windows Phone
Asked by
jon
Top achievements
Rank 1
Answers by
jon
Top achievements
Rank 1
Zdravko
Telerik team
ABECON Groep BV
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or