@snstarosciak wrote:
Has anyone else had this issue?
When I use the cordova media plugin in order to play an mp3 file on iOS, I get no error or response as to why it's not working.
I've gotten the ngCordova media plugin to work in my app on my ios emulator, using an external URL to play the audio file...however, I'm trying to build some functionality where basically you download the mp3 from an external source, save it to your device, and then play the file from there. I can't seem to get it work, even though I can verify that the file does exist. Here is my code for the function:
$scope.playAudio = function() { document.addEventListener('deviceready', function () { var src = cordova.file.dataDirectory + fileSrc; var media = $cordovaMedia.newMedia(src); var iOSPlayOptions = { numberOfLoops: 1, playAudioWhenScreenIsLocked : true }; media.play(iOSPlayOptions); // iOS only! media.play(); // Android }); }
I should note that this functionality DOES work on my android device, but on both my ios simulator AND real device, it does absolutely nothing.
I should note that I'm using iOS 9 and xCode 7.1
Has anyone else had any issues with trying to play an audio or video file from their local device, in their app?
Posts: 1
Participants: 1