2
votes

I am developing Media Player for both android and iPhone using ionic platform.

Player having the record audio and play functionality.

I completed with code using this link : https://github.com/apache/cordova-plugin-media .

The ios app is getting crash when I record audio, save it in local storage and play on player. It is working fine in many cases.

I have debug the code and found crash log and console on XCode IDE. Following is the cause of crashing :

exception nativeEvalAndFetch : ReferenceError: Can't find variable: nan

This may be a plugin issue. I am stuck on this. If any Idea about why this is causing random crash, please share.

1
Did you find any solution to this? - Kishan Vaishnav

1 Answers

0
votes

Searched for too long for this simple answer after it was working on Andriod, and I finally tested on iOS

import {normalizeURL} from 'ionic-angular';

MediaSource = document.createElement("audio");
MediaSource.src = normalizeURL(cordova.file.dataDirectory + file.fullPath);

Hope this helps.