Fix(ios): fix real time issue when fast zapping (#3582)

* fix(ios): fix real time issue when doing fast zapping

* fix(ios): fix delay implementation (timing was not applied correctly)

* chore: fix random crash in sample

* chore: fix linter
This commit is contained in:
Olivier Bouillet
2024-03-14 11:46:45 +01:00
committed by GitHub
parent f4cce2ecdb
commit 429fddf3b0
3 changed files with 59 additions and 10 deletions

View File

@@ -364,7 +364,7 @@ enum RCTVideoUtils {
static func delay(seconds: Int = 0) -> Promise<Void> {
return Promise<Void>(on: .global()) { fulfill, _ in
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(seconds)) / Double(NSEC_PER_SEC)) {
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(seconds)) {
fulfill(())
}
}