Ios - ionic - Cordova Plugin Media - getCurrentPosition - NSInvalidArgumentException

时间:2018-02-11 15:27:06

标签: ios xcode cordova ionic-framework

我正在尝试获取getCurrentPosition() 我只收到Xcode的错误

this.iosAudio_file.getCurrentPosition().then((position) => {
    console.log("audio position: " + position);
 }).catch(_=>{
      console.log("position error: ");
 });

Xcode的错误:

2018-02-06 03:58:46.786217-0800 [2342:1572180] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> Invalid number value (NaN) in JSON write
2018-02-06 03:58:46.789125-0800 [2342:1572180] exception nativeEvalAndFetch : ReferenceError: Can't find variable: nan

的package.json

&#34; cordova-plugin-media&#34;:&#34; ^ 5.0.2&#34;,

config.xml

    <plugin name="cordova-plugin-media" spec="^5.0.2">
         <variable name="KEEP_AVAUDIOSESSION_ALWAYS_ACTIVE" value="NO" />
    </plugin>

1 个答案:

答案 0 :(得分:0)

这是一个错误,应尽快修复

https://issues.apache.org/jira/browse/CB-13852