Skip to content

Commit

Permalink
✨ Add the channel param for enableTrafficControl function
Browse files Browse the repository at this point in the history
  • Loading branch information
hejie committed Oct 9, 2023
1 parent de465b1 commit 86de446
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,9 @@ public static void enableTrafficControl(MethodCall call, Result result) {

boolean enable = ZegoUtils.boolValue((Boolean) call.argument("enable"));
int property = ZegoUtils.intValue((Number) call.argument("property"));
ZegoPublishChannel channel = ZegoPublishChannel.getZegoPublishChannel(ZegoUtils.intValue((Number) call.argument("channel")));

ZegoExpressEngine.getEngine().enableTrafficControl(enable, property);
ZegoExpressEngine.getEngine().enableTrafficControl(enable, property, channel);

result.success(null);
}
Expand Down
3 changes: 2 additions & 1 deletion ios/Classes/internal/ZegoExpressEngineMethodHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,9 @@ - (void)enableTrafficControl:(FlutterMethodCall *)call result:(FlutterResult)res

BOOL enable = [ZegoUtils boolValue:call.arguments[@"enable"]];
int property = [ZegoUtils intValue:call.arguments[@"property"]];
int channel = [ZegoUtils intValue:call.arguments[@"channel"]];

[[ZegoExpressEngine sharedEngine] enableTrafficControl:enable property:(ZegoTrafficControlProperty)property];
[[ZegoExpressEngine sharedEngine] enableTrafficControl:enable property:(ZegoTrafficControlProperty)property channel:(ZegoPublishChannel)channel];

result(nil);
}
Expand Down
4 changes: 3 additions & 1 deletion windows/internal/ZegoExpressEngineMethodHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3216,8 +3216,10 @@ void ZegoExpressEngineMethodHandler::enableTrafficControl(
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
auto enable = std::get<bool>(argument[FTValue("enable")]);
auto property = std::get<int32_t>(argument[FTValue("property")]);
auto channel = std::get<int32_t>(argument[FTValue("channel")]);

EXPRESS::ZegoExpressSDK::getEngine()->enableTrafficControl(enable, property);
EXPRESS::ZegoExpressSDK::getEngine()->enableTrafficControl(enable, property,
(EXPRESS::ZegoPublishChannel)channel);
result->Success();
}

Expand Down

0 comments on commit 86de446

Please sign in to comment.