diff --git a/RCTVideo.m b/RCTVideo.m index 0e23da0f..f211f4e3 100644 --- a/RCTVideo.m +++ b/RCTVideo.m @@ -23,7 +23,6 @@ [_player setContentURL:videoURL]; [_player setControlStyle:MPMovieControlStyleNone]; [_player setScalingMode:MPMovieScalingModeNone]; - [_player setRepeatMode:MPMovieRepeatModeOne]; [_player prepareToPlay]; [_player play]; } @@ -33,6 +32,15 @@ [_player setScalingMode:mode]; } +- (void)setRepeat:(BOOL)repeat +{ + if (repeat) { + [_player setRepeatMode:MPMovieRepeatModeOne]; + } else { + [_player setRepeatMode:MPMovieRepeatModeNone]; + } +} + - (NSArray *)reactSubviews { NSArray *subviews = @[_player.view]; diff --git a/RCTVideoManager.m b/RCTVideoManager.m index 86f7d849..08acd0fc 100644 --- a/RCTVideoManager.m +++ b/RCTVideoManager.m @@ -14,6 +14,7 @@ RCT_EXPORT_VIEW_PROPERTY(src, NSString); RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSInteger); +RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL); - (NSDictionary *)constantsToExport { diff --git a/README.md b/README.md index 20102b52..cbb7663e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A