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,