fix(ios): remove false calls at onPlaybackRateChange (#3306)

This commit is contained in:
Krzysztof Moch
2023-10-24 22:10:29 +02:00
committed by GitHub
parent 9373493d6a
commit 286418e4a5
2 changed files with 5 additions and 1 deletions

View File

@@ -1221,6 +1221,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
func handlePlaybackRateChange(player: AVPlayer, change: NSKeyValueObservedChange<Float>) {
guard let _player = _player else { return }
if(player.rate == change.oldValue && change.oldValue != nil) {
return
}
onPlaybackRateChange?(["playbackRate": NSNumber(value: _player.rate),
"target": reactTag as Any])