nstudio / nativescript-audio

:microphone: NativeScript plugin to record and play audio :musical_note:
Other
149 stars 104 forks source link

IOS App crash if there is no audio #94

Open HunterJS-bit opened 6 years ago

HunterJS-bit commented 6 years ago

Hello guys I have issue on my iphone, also this is happening with your demo app you can test If I try to play some audio from url, and that url is invalid or doesnt contain audio File app will crash Sample code:

var playerOptions = {
        audioFile: 'test.com' + "record/get/" + 'samplesong.mp3',
        loop: false,
        completeCallback: function () {
            console.log('finished playing')
        },
        errorCallback: function (errorObject) {
            console.log(JSON.stringify(errorObject));
        },
        infoCallback: function (args) {
            console.log(JSON.stringify(args));
        }
    };

    player.playFromUrl(playerOptions)
        .then(function (res) {
            console.log(res);
        })
        .catch(function () {
            console.log("something went wrong...");
        })
HunterJS-bit commented 6 years ago

Anybody ????

bradmartin commented 6 years ago

Does it get to the catch or you mean it actually crashes the app?

bradmartin commented 6 years ago

I can't reproduce this on the simulator, are you on a sim or device, what iOS version, etc? Thanks

HunterJS-bit commented 6 years ago

IPhone 8, IOS11 :) It doesnt go to catch block it just crashes whole app.

HunterJS-bit commented 6 years ago

Were you able to reproduce it ?????

bradmartin commented 6 years ago

Haven't had any time to look into this right now. Sorry. You can try the slack channel for NS if you need some help faster or the NS forums are really awesome. Tons of helpful developers, I'm just short on time right now.