diff --git a/RCTVideo.m b/RCTVideo.m index 9923e23e..ad2d7b8a 100644 --- a/RCTVideo.m +++ b/RCTVideo.m @@ -37,6 +37,7 @@ static NSString *const statusKeyPath = @"status"; float _volume; float _rate; BOOL _muted; + BOOL _paused; } - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher { @@ -158,7 +159,6 @@ static NSString *const statusKeyPath = @"status"; [self startProgressTimer]; [self attachListeners]; - [_player play]; [self applyModifiers]; } else if(_playerItem.status == AVPlayerItemStatusFailed) { [_eventDispatcher sendInputEventWithName:RNVideoEventLoadingError body:@{ @@ -186,7 +186,6 @@ static NSString *const statusKeyPath = @"status"; - (void)playerItemDidReachEnd:(NSNotification *)notification { AVPlayerItem *item = [notification object]; [item seekToTime:kCMTimeZero]; - [_player play]; [self applyModifiers]; } @@ -203,8 +202,9 @@ static NSString *const statusKeyPath = @"status"; } else { [self startProgressTimer]; [_player play]; - } + + _paused = paused; } - (void)setSeek:(float)seekTime { @@ -265,6 +265,7 @@ static NSString *const statusKeyPath = @"status"; } [_player setRate:_rate]; + [self setPaused:_paused]; } - (void)setRepeatEnabled { diff --git a/RCTVideoManager.m b/RCTVideoManager.m index 25edc92c..172c3f4f 100644 --- a/RCTVideoManager.m +++ b/RCTVideoManager.m @@ -51,10 +51,12 @@ RCT_EXPORT_VIEW_PROPERTY(seek, float); - (NSDictionary *)constantsToExport { - return @{@"ScaleNone": AVLayerVideoGravityResizeAspect, - @"ScaleToFill": AVLayerVideoGravityResize, - @"ScaleAspectFit": AVLayerVideoGravityResizeAspect, - @"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill}; + return @{ + @"ScaleNone": AVLayerVideoGravityResizeAspect, + @"ScaleToFill": AVLayerVideoGravityResize, + @"ScaleAspectFit": AVLayerVideoGravityResizeAspect, + @"ScaleAspectFill": AVLayerVideoGravityResizeAspectFill + }; } @end diff --git a/Video.ios.js b/Video.ios.js index 4f6a9cd0..22d29868 100644 --- a/Video.ios.js +++ b/Video.ios.js @@ -14,7 +14,6 @@ var deepDiffer = require('deepDiffer'); var Video = React.createClass({ propTypes: { - // should probably be a shape source: PropTypes.object, style: StyleSheetPropType(VideoStylePropTypes), source: PropTypes.object, diff --git a/package.json b/package.json index de1ea3d4..4e8375b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "0.3.2", + "version": "0.3.3", "description": "A