You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/08/23 20:20:47 UTC

[GitHub] [cordova-plugin-media] baffalop opened a new issue #250: Native exception thrown when two media elements are playing on iOS

baffalop opened a new issue #250: Native exception thrown when two media elements are playing on iOS
URL: https://github.com/apache/cordova-plugin-media/issues/250
 
 
   # Bug Report
   
   ## Problem
   
   There are moments in my app when two media elements overlap, both playing at the same time. If at this time I attempt to call methods `play`, `pause`, `getCurrentPosition` on one of the media instances, Safari console shows:
   
   ```
   exception nativeEvalAndFetch : ReferenceError: Can't find variable: nan (cordova.js:1509)
   ```
   
   Xcode shows:
   ```
   MyApp[6013:751153] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> Invalid number value (NaN) in JSON write
   MyApp[6013:751153] exception nativeEvalAndFetch : ReferenceError: Can't find variable: nan
   ```
   
   As soon as I release one of these media instances (or when one of them is stopped - I release it as soon as it reaches the end) the methods called on the remaining instance behave correctly again.
   
   ### What is expected to happen?
   
   Normal execution of `play`, `pause` or `getCurrentPosition`.
   
   ### What does actually happen?
   
   Exception is logged. `pause` has no effect. `getCurrentPosition` does not call the callback. `play` restarts both media instances from the beginning.
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   
   Tested on iPhone 6 running iOS 12.4
   Also tested in emulator for iPhone XR
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   Cordova: 9.0.0 (cordova-lib@9.0.1)
   cordova-plugin-file 6.0.2 "File"
   cordova-plugin-media 5.0.3 "Media"
   cordova-plugin-music-controls 2.2.0 "MusicControls"
   cordova-plugin-splashscreen 5.0.3 "Splashscreen"
   cordova-plugin-whitelist 1.3.4 "Whitelist"
   
   Xcode: 10.3 (10G8)
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org