Skip to content

Commit

Permalink
Merge pull request flutter#2 from recastrodiaz/speed
Browse files Browse the repository at this point in the history
Renamed setPlaybackSpeed to setSpeed on iOS
  • Loading branch information
JONA-Cureambit authored May 27, 2019
2 parents 0ad74cc + 3209ac0 commit b6a3522
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/video_player/ios/Classes/VideoPlayerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ - (void)setVolume:(double)volume {
_player.volume = (float)((volume < 0.0) ? 0.0 : ((volume > 1.0) ? 1.0 : volume));
}

- (void)setPlayBackSpeed:(double)speed {
- (void)setSpeed:(double)speed {
if (speed == 1.0 || speed == 0.0) {
_player.rate = speed;
} else if (speed < 0 || speed > 2.0) {
Expand Down Expand Up @@ -517,8 +517,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
} else if ([@"pause" isEqualToString:call.method]) {
[player pause];
result(nil);
} else if ([@"setPlayBackSpeed" isEqualToString:call.method]) {
[player setPlayBackSpeed:[[argsMap objectForKey:@"speed"] doubleValue]];
} else if ([@"setSpeed" isEqualToString:call.method]) {
[player setSpeed:[[argsMap objectForKey:@"speed"] doubleValue]];
result(nil);
} else {
result(FlutterMethodNotImplemented);
Expand Down

0 comments on commit b6a3522

Please sign in to comment.