From 6e43701092f5f480eab8ae005a4bc729bb21b5c1 Mon Sep 17 00:00:00 2001 From: Ahmed Hassan Date: Sat, 18 Nov 2017 23:10:58 +0100 Subject: [PATCH] added native progress notification (#734) --- ios/RCTVideo.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/RCTVideo.m b/ios/RCTVideo.m index 9962c2bb..58eaf608 100644 --- a/ios/RCTVideo.m +++ b/ios/RCTVideo.m @@ -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)],