Media Plugin IOS Reproducing Audio


#1

Hi,

I’m trying to reproduce a mp3 file downloaded from a server. Until now the solution works fine with Android, but when I try with IOS I get the following output:

2016-09-07 18:22:13.560 media-ionic[1899:861836] Will attempt to use file resource 'file:///var/mobile/Containers/Data/Application/2BB07EE1-9752-408A-A921-58E6629D7D97/Library/NoCloud/descarga.mp3'

2016-09-07 18:22:13.561 media-ionic[1899:861836] Unknown resource 'file:///var/mobile/Containers/Data/Application/2BB07EE1-9752-408A-A921-58E6629D7D97/Library/NoCloud/descarga.mp3'

2016-09-07 18:22:13.566 media-ionic[1899:866713] Will attempt to use file resource 'file:///var/mobile/Containers/Data/Application/2BB07EE1-9752-408A-A921-58E6629D7D97/Library/NoCloud/descarga.mp3'

2016-09-07 18:22:13.566 media-ionic[1899:866713] Unknown resource 'file:///var/mobile/Containers/Data/Application/2BB07EE1-9752-408A-A921-58E6629D7D97/Library/NoCloud/descarga.mp3'

2016-09-07 18:22:13.570 media-ionic[1899:861836] ERROR: Unhandled Promise rejection: [object Object] ; Zone: <root> ; Task:  ; Value: [object Object]

2016-09-07 18:22:13.571 media-ionic[1899:861836] ERROR: error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.

My code:


download(source:string, target:string){

  const fileTransfer = new Transfer();

fileTransfer.download(source, target, true)

   .then((data) => { this.playAudio(target) })

  }

playAudio(file:string){

        var media = new MediaPlugin(file)

        media.play()

}

Thanks,


#2

I got the same problem in iOS. Please help!


#3

Hi any advance in this issue? I have the same problem. Best regards


#4

Was anyone able to find a solution to this? Facing the same


#5

Was anyone able to find a solution to this?


#6

#7

my problem was the path, in android just works but in ios i have to remove the “file://” from the path