arielfaur / ionic-audio

An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
http://arielfaur.github.io/ionic-audio/2.0/index.html
MIT License
321 stars 163 forks source link

Audio stored in native #70

Closed lync0056 closed 8 years ago

lync0056 commented 8 years ago

Hello,

I've been using the ionic-audio directive perfectly fine when playing from local storage or an external server. Just recently have attempted to download the audio from a server and store in native storage using $cordovaFileTransfer & $cordovaFile. Then play it.

I point the $scope.track url to the nativeURL which returns as below for ios;

file:///var/mobile/Containers/Data/Application/XXX-000/Library/NoCloud/example.mp3

It will not play. It can't seem to locate the file. Hoping somebody may have a comment, suggestion, tutorial, example?

Many thanks. My code below.

screen shot 2016-08-19 at 2 22 29 pm

lync0056 commented 8 years ago

Hey I found this @arielfaur where you are actually talking about the exact issue. https://forum.ionicframework.com/t/ios-9-cant-play-audio-video-files-that-are-downloaded-to-device/37580/3

All I needed to do was change result.toURL() to result.toInternalURL() and it works.