Skip to content

Commit

Permalink
fix: [windows] Fix can not get irisRtcRenderingHandle in 32-bit (#1311
Browse files Browse the repository at this point in the history
)
  • Loading branch information
littleGnAl committed Sep 12, 2023
1 parent b5e5cff commit 7438fb2
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions windows/video_view_controller.cc
Expand Up @@ -58,25 +58,34 @@ void VideoViewController::HandleMethodCall(
return;
}

intptr_t irisRtcRenderingHandle;
if (!GetValueFromEncodableMap(arguments, "irisRtcRenderingHandle", irisRtcRenderingHandle))
int64_t irisRtcRenderingHandle;
{
result->Error("Invalid arguments", "No irisRtcRenderingHandle provided.");
return;
auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("irisRtcRenderingHandle")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The `irisRtcRenderingHandle` maybe in 32-bit on some devices, we need call `LongValue` explictly
irisRtcRenderingHandle = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No irisRtcRenderingHandle provided.");
return;
}
}

int64_t uid;

auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("uid")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The uid may between 32-bit and 64-bit value, we need call `LongValue` explictly
uid = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No uid provided.");
return;
auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("uid")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The uid may between 32-bit and 64-bit value, we need call `LongValue` explictly
uid = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No uid provided.");
return;
}
}

std::string channelId;
Expand Down

0 comments on commit 7438fb2

Please sign in to comment.