Update progress every 250ms
This commit is contained in:
parent
d22d75c332
commit
d52e83d901
@ -26,7 +26,7 @@
|
|||||||
_eventDispatcher = eventDispatcher;
|
_eventDispatcher = eventDispatcher;
|
||||||
|
|
||||||
/* Initialize videoProgress status publisher */
|
/* Initialize videoProgress status publisher */
|
||||||
_progressUpdateInterval = 1;
|
_progressUpdateInterval = 250;
|
||||||
_prevProgressUpdateTime = nil;
|
_prevProgressUpdateTime = nil;
|
||||||
_progressUpdateTimer = [CADisplayLink displayLinkWithTarget:self selector:@selector(sendProgressUpdate)];
|
_progressUpdateTimer = [CADisplayLink displayLinkWithTarget:self selector:@selector(sendProgressUpdate)];
|
||||||
[_progressUpdateTimer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
|
[_progressUpdateTimer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
|
||||||
@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_prevProgressUpdateTime == nil ||
|
if (_prevProgressUpdateTime == nil ||
|
||||||
((int) [[NSDate date] timeIntervalSinceDate: _prevProgressUpdateTime]) >= _progressUpdateInterval) {
|
(([_prevProgressUpdateTime timeIntervalSinceNow] * -1000.0) >= _progressUpdateInterval)) {
|
||||||
[_eventDispatcher sendInputEventWithName:@"videoProgress" body:@{
|
[_eventDispatcher sendInputEventWithName:@"videoProgress" body:@{
|
||||||
@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(video.currentTime)],
|
@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(video.currentTime)],
|
||||||
@"target": self.reactTag
|
@"target": self.reactTag
|
||||||
|
Loading…
Reference in New Issue
Block a user