Loading RCTVideo.h +4 −4 Changes for RCTVideo.h: 4 added lines, 4 removed lines. Original line number Diff line number Diff line #import "RCTView.h" extern NSString *const RNVideoLoadedEvent; extern NSString *const RNVideoLoadingEvent; extern NSString *const RNVideoProgressEvent; extern NSString *const RNVideoLoadingErrorEvent; extern NSString *const RNVideoEventLoaded; extern NSString *const RNVideoEventLoading; extern NSString *const RNVideoEventProgress; extern NSString *const RNVideoEventLoadingError; @class RCTEventDispatcher; Loading RCTVideo.m +7 −7 Changes for RCTVideo.m: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -5,10 +5,10 @@ #import "UIView+React.h" #import <AVFoundation/AVFoundation.h> NSString *const RNVideoLoadedEvent = @"videoLoaded"; NSString *const RNVideoLoadingEvent = @"videoLoading"; NSString *const RNVideoProgressEvent = @"videoProgress"; NSString *const RNVideoLoadingErrorEvent = @"videoLoadError"; NSString *const RNVideoEventLoaded = @"videoLoaded"; NSString *const RNVideoEventLoading = @"videoLoading"; NSString *const RNVideoEventProgress = @"videoProgress"; NSString *const RNVideoEventLoadingError = @"videoLoadError"; static NSString *const statusKeyPath = @"status"; Loading Loading @@ -54,7 +54,7 @@ static NSString *const statusKeyPath = @"status"; if (_prevProgressUpdateTime == nil || (([_prevProgressUpdateTime timeIntervalSinceNow] * -1000.0) >= _progressUpdateInterval)) { [_eventDispatcher sendInputEventWithName:RNVideoProgressEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventProgress body:@{ @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(video.currentTime)], @"target": self.reactTag }]; Loading Loading @@ -88,7 +88,7 @@ static NSString *const statusKeyPath = @"status"; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; [_eventDispatcher sendInputEventWithName:RNVideoLoadingEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventLoadingError body:@{ @"src": @{ @"uri":uri, @"type": type, Loading @@ -101,7 +101,7 @@ static NSString *const statusKeyPath = @"status"; - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (object == _playerItem) { if (_playerItem.status == AVPlayerItemStatusReadyToPlay) { [_eventDispatcher sendInputEventWithName:RNVideoLoadedEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventLoaded body:@{ @"duration": [NSNumber numberWithFloat:CMTimeGetSeconds(_playerItem.duration)], @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(_playerItem.currentTime)], @"canPlayReverse": [NSNumber numberWithBool:_playerItem.canPlayReverse], Loading RCTVideoManager.m +4 −4 Changes for RCTVideoManager.m: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -17,16 +17,16 @@ - (NSDictionary *)customDirectEventTypes { return @{ RNVideoLoadingEvent: @{ RNVideoEventLoading: @{ @"registrationName": @"onLoadStart" }, RNVideoLoadedEvent: @{ RNVideoEventLoaded: @{ @"registrationName": @"onLoad" }, RNVideoLoadingErrorEvent: @{ RNVideoEventLoadingError: @{ @"registrationName": @"onError" }, RNVideoProgressEvent: @{ RNVideoEventProgress: @{ @"registrationName": @"onProgress" }, }; Loading Loading
RCTVideo.h +4 −4 Changes for RCTVideo.h: 4 added lines, 4 removed lines. Original line number Diff line number Diff line #import "RCTView.h" extern NSString *const RNVideoLoadedEvent; extern NSString *const RNVideoLoadingEvent; extern NSString *const RNVideoProgressEvent; extern NSString *const RNVideoLoadingErrorEvent; extern NSString *const RNVideoEventLoaded; extern NSString *const RNVideoEventLoading; extern NSString *const RNVideoEventProgress; extern NSString *const RNVideoEventLoadingError; @class RCTEventDispatcher; Loading
RCTVideo.m +7 −7 Changes for RCTVideo.m: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -5,10 +5,10 @@ #import "UIView+React.h" #import <AVFoundation/AVFoundation.h> NSString *const RNVideoLoadedEvent = @"videoLoaded"; NSString *const RNVideoLoadingEvent = @"videoLoading"; NSString *const RNVideoProgressEvent = @"videoProgress"; NSString *const RNVideoLoadingErrorEvent = @"videoLoadError"; NSString *const RNVideoEventLoaded = @"videoLoaded"; NSString *const RNVideoEventLoading = @"videoLoading"; NSString *const RNVideoEventProgress = @"videoProgress"; NSString *const RNVideoEventLoadingError = @"videoLoadError"; static NSString *const statusKeyPath = @"status"; Loading Loading @@ -54,7 +54,7 @@ static NSString *const statusKeyPath = @"status"; if (_prevProgressUpdateTime == nil || (([_prevProgressUpdateTime timeIntervalSinceNow] * -1000.0) >= _progressUpdateInterval)) { [_eventDispatcher sendInputEventWithName:RNVideoProgressEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventProgress body:@{ @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(video.currentTime)], @"target": self.reactTag }]; Loading Loading @@ -88,7 +88,7 @@ static NSString *const statusKeyPath = @"status"; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; [_eventDispatcher sendInputEventWithName:RNVideoLoadingEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventLoadingError body:@{ @"src": @{ @"uri":uri, @"type": type, Loading @@ -101,7 +101,7 @@ static NSString *const statusKeyPath = @"status"; - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (object == _playerItem) { if (_playerItem.status == AVPlayerItemStatusReadyToPlay) { [_eventDispatcher sendInputEventWithName:RNVideoLoadedEvent body:@{ [_eventDispatcher sendInputEventWithName:RNVideoEventLoaded body:@{ @"duration": [NSNumber numberWithFloat:CMTimeGetSeconds(_playerItem.duration)], @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(_playerItem.currentTime)], @"canPlayReverse": [NSNumber numberWithBool:_playerItem.canPlayReverse], Loading
RCTVideoManager.m +4 −4 Changes for RCTVideoManager.m: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -17,16 +17,16 @@ - (NSDictionary *)customDirectEventTypes { return @{ RNVideoLoadingEvent: @{ RNVideoEventLoading: @{ @"registrationName": @"onLoadStart" }, RNVideoLoadedEvent: @{ RNVideoEventLoaded: @{ @"registrationName": @"onLoad" }, RNVideoLoadingErrorEvent: @{ RNVideoEventLoadingError: @{ @"registrationName": @"onError" }, RNVideoProgressEvent: @{ RNVideoEventProgress: @{ @"registrationName": @"onProgress" }, }; Loading