Loading RCTVideo.m +13 −1 Changes for RCTVideo.m: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ static NSString *const statusKeyPath = @"status"; float _rate; BOOL _muted; BOOL _paused; BOOL _repeat; NSString * _resizeMode; } - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher Loading @@ -48,6 +50,8 @@ static NSString *const statusKeyPath = @"status"; _rate = 1.0; _volume = 1.0; _resizeMode = @"AVLayerVideoGravityResizeAspectFill"; _pendingSeek = false; _pendingSeekTime = 0.0f; _lastSeekTime = 0.0f; Loading Loading @@ -156,6 +160,8 @@ static NSString *const statusKeyPath = @"status"; _playerLayer.frame = self.bounds; _playerLayer.needsDisplayOnBoundsChange = YES; [self applyModifiers]; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; Loading Loading @@ -216,7 +222,7 @@ static NSString *const statusKeyPath = @"status"; } else if(_playerItem.status == AVPlayerItemStatusFailed) { [_eventDispatcher sendInputEventWithName:RNVideoEventLoadingError body:@{ @"error": @{ @"code": [NSNumber numberWithInt:_playerItem.error.code], @"code": [NSNumber numberWithInt: (int)_playerItem.error.code], @"domain": _playerItem.error.domain }, @"target": self.reactTag Loading Loading @@ -248,6 +254,7 @@ static NSString *const statusKeyPath = @"status"; - (void)setResizeMode:(NSString*)mode { _resizeMode = mode; _playerLayer.videoGravity = mode; } Loading Loading @@ -327,6 +334,9 @@ static NSString *const statusKeyPath = @"status"; } [_player setRate:_rate]; [self setResizeMode:_resizeMode]; [self setRepeat:_repeat]; [self setPaused:_paused]; } Loading @@ -344,6 +354,8 @@ static NSString *const statusKeyPath = @"status"; } - (void)setRepeat:(BOOL)repeat { _repeat = repeat; if (repeat) { [self setRepeatEnabled]; } else { Loading Loading
RCTVideo.m +13 −1 Changes for RCTVideo.m: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ static NSString *const statusKeyPath = @"status"; float _rate; BOOL _muted; BOOL _paused; BOOL _repeat; NSString * _resizeMode; } - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher Loading @@ -48,6 +50,8 @@ static NSString *const statusKeyPath = @"status"; _rate = 1.0; _volume = 1.0; _resizeMode = @"AVLayerVideoGravityResizeAspectFill"; _pendingSeek = false; _pendingSeekTime = 0.0f; _lastSeekTime = 0.0f; Loading Loading @@ -156,6 +160,8 @@ static NSString *const statusKeyPath = @"status"; _playerLayer.frame = self.bounds; _playerLayer.needsDisplayOnBoundsChange = YES; [self applyModifiers]; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; Loading Loading @@ -216,7 +222,7 @@ static NSString *const statusKeyPath = @"status"; } else if(_playerItem.status == AVPlayerItemStatusFailed) { [_eventDispatcher sendInputEventWithName:RNVideoEventLoadingError body:@{ @"error": @{ @"code": [NSNumber numberWithInt:_playerItem.error.code], @"code": [NSNumber numberWithInt: (int)_playerItem.error.code], @"domain": _playerItem.error.domain }, @"target": self.reactTag Loading Loading @@ -248,6 +254,7 @@ static NSString *const statusKeyPath = @"status"; - (void)setResizeMode:(NSString*)mode { _resizeMode = mode; _playerLayer.videoGravity = mode; } Loading Loading @@ -327,6 +334,9 @@ static NSString *const statusKeyPath = @"status"; } [_player setRate:_rate]; [self setResizeMode:_resizeMode]; [self setRepeat:_repeat]; [self setPaused:_paused]; } Loading @@ -344,6 +354,8 @@ static NSString *const statusKeyPath = @"status"; } - (void)setRepeat:(BOOL)repeat { _repeat = repeat; if (repeat) { [self setRepeatEnabled]; } else { Loading