mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-08 12:52:51 +00:00
added native progress notification (#734)
This commit is contained in:
committed by
Matt Apperson
parent
1ba6b062e4
commit
6e43701092
@@ -188,6 +188,9 @@ static NSString *const timedMetadata = @"timedMetadata";
|
||||
CMTime currentTime = _player.currentTime;
|
||||
const Float64 duration = CMTimeGetSeconds(playerDuration);
|
||||
const Float64 currentTimeSecs = CMTimeGetSeconds(currentTime);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"RCTVideo_progress" object:nil userInfo:@{@"progress": [NSNumber numberWithDouble: currentTimeSecs / duration]}];
|
||||
|
||||
if( currentTimeSecs >= 0 && self.onVideoProgress) {
|
||||
self.onVideoProgress(@{
|
||||
@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(currentTime)],
|
||||
|
||||
Reference in New Issue
Block a user