Add onPlaybackRateChange callback
This commit is contained in:
parent
f244f662b6
commit
b55f71a29d
@ -317,6 +317,12 @@ static NSString *const playbackRate = @"rate";
|
|||||||
body:@{@"target": self.reactTag}];
|
body:@{@"target": self.reactTag}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (object == _player) {
|
||||||
|
if([keyPath isEqualToString:playbackRate] && [change objectForKey:NSKeyValueChangeNewKey]) {
|
||||||
|
[_eventDispatcher sendInputEventWithName:@"onPlaybackRateChange"
|
||||||
|
body:@{@"playbackRate": _player.rate,
|
||||||
|
@"target": self.reactTag}];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,8 @@ RCT_EXPORT_MODULE();
|
|||||||
@"onVideoFullscreenPlayerDidPresent",
|
@"onVideoFullscreenPlayerDidPresent",
|
||||||
@"onVideoFullscreenPlayerWillDismiss",
|
@"onVideoFullscreenPlayerWillDismiss",
|
||||||
@"onVideoFullscreenPlayerDidDismiss",
|
@"onVideoFullscreenPlayerDidDismiss",
|
||||||
@"onReadyForDisplay"
|
@"onReadyForDisplay",
|
||||||
|
@"onPlaybackRateChange"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user