You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2022/08/30 09:30:51 UTC
[cordova-plugin-media] branch master updated: prevent error on getPosition (#353)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media.git
The following commit(s) were added to refs/heads/master by this push:
new a6f23cc prevent error on getPosition (#353)
a6f23cc is described below
commit a6f23cc26e3e56cd4ade699557dd04d5ffff3daa
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Tue Aug 30 18:30:45 2022 +0900
prevent error on getPosition (#353)
When I try to get the position of an audio that had an error while loading, the crash appose exponentially because it can not cast the time = none
Co-authored-by: LKS <al...@gmail.com>
---
src/ios/CDVSound.m | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m
index 5c40590..c92cd02 100644
--- a/src/ios/CDVSound.m
+++ b/src/ios/CDVSound.m
@@ -659,6 +659,10 @@ BOOL keepAvAudioSessionAlwaysActive = NO;
position = CMTimeGetSeconds(time);
}
+ if (isnan(position)){
+ position = -1;
+ }
+
CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:position];
[self onStatus:MEDIA_POSITION mediaId:mediaId param:@(position)];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org