fix(ios): remove false calls at onPlaybackRateChange
(#3306)
This commit is contained in:
parent
9373493d6a
commit
286418e4a5
@ -94,7 +94,7 @@ class RCTPlayerObserver: NSObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_playerRateChangeObserver = player.observe(\.rate, changeHandler: _handlers.handlePlaybackRateChange)
|
_playerRateChangeObserver = player.observe(\.rate, options: [.old], changeHandler: _handlers.handlePlaybackRateChange)
|
||||||
_playerExternalPlaybackActiveObserver = player.observe(\.isExternalPlaybackActive, changeHandler: _handlers.handleExternalPlaybackActiveChange)
|
_playerExternalPlaybackActiveObserver = player.observe(\.isExternalPlaybackActive, changeHandler: _handlers.handleExternalPlaybackActiveChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1221,6 +1221,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
func handlePlaybackRateChange(player: AVPlayer, change: NSKeyValueObservedChange<Float>) {
|
func handlePlaybackRateChange(player: AVPlayer, change: NSKeyValueObservedChange<Float>) {
|
||||||
guard let _player = _player else { return }
|
guard let _player = _player else { return }
|
||||||
|
|
||||||
|
if(player.rate == change.oldValue && change.oldValue != nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
onPlaybackRateChange?(["playbackRate": NSNumber(value: _player.rate),
|
onPlaybackRateChange?(["playbackRate": NSNumber(value: _player.rate),
|
||||||
"target": reactTag as Any])
|
"target": reactTag as Any])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user