audio not playing

7 posts, 0 answers
  1. jon
    jon avatar
    20 posts
    Member since:
    Jul 2014

    Posted 31 Jul 2014 Link to this post

    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.
  2. jon
    jon avatar
    20 posts
    Member since:
    Jul 2014

    Posted 02 Aug 2014 Link to this post

    i fixed it by using new Audio(src).play() instead for Windows Phone
  3. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 04 Aug 2014 Link to this post

    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.

     
  4. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 02 Sep 2015 in reply to Zdravko Link to this post

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

    Is this a known issue?

  5. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 07 Sep 2015 Link to this post

    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.

     
  6. ABECON Groep BV
    ABECON Groep BV avatar
    28 posts
    Member since:
    Apr 2007

    Posted 25 Sep 2015 in reply to Kaloyan Link to this post

    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

     

     

     

  7. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 30 Sep 2015 Link to this post

    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.

     
Back to Top