fix(android): return the value as a float for the getCurrentPosition function (#4054)

* fix(android): return value for getCurrentPosition function

* fix: remove additional casting
This commit is contained in:
Seyed Mostafa Hasani 2024-08-05 13:28:33 +03:30 committed by GitHub
parent 74c6dd6279
commit af0302b1b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -717,7 +717,7 @@ public class ReactExoplayerView extends FrameLayout implements
public void getCurrentPosition(Promise promise) { public void getCurrentPosition(Promise promise) {
if (player != null) { if (player != null) {
double currentPosition = player.getCurrentPosition() / 1000; float currentPosition = player.getCurrentPosition() / 1000.0f;
promise.resolve(currentPosition); promise.resolve(currentPosition);
} else { } else {
promise.reject("PLAYER_NOT_AVAILABLE", "Player is not initialized."); promise.reject("PLAYER_NOT_AVAILABLE", "Player is not initialized.");