fix(windows): conversion of string to Stretch enum (#4381)

This commit is contained in:
darth levi
2025-01-23 01:32:25 +04:00
committed by GitHub
parent d9f92b800e
commit d90bf47df5
@@ -69,7 +69,16 @@ void ReactVideoViewManager::UpdateProperties(
auto const &uri = srcMap.at("uri");
reactVideoView.Set_UriString(to_hstring(uri.AsString()));
} else if (propertyName == "resizeMode") {
reactVideoView.Stretch(static_cast<Stretch>(std::stoul(propertyValue.AsString())));
auto resizeModeString = propertyValue.AsString();
Stretch resizeMode = Stretch::None;
if (resizeModeString == "contain") {
resizeMode = Stretch::Uniform;
} else if (resizeModeString == "stretch") {
resizeMode = Stretch::Fill;
} else if (resizeModeString == "cover") {
resizeMode = Stretch::UniformToFill;
}
reactVideoView.Stretch(resizeMode);
} else if (propertyName == "repeat") {
reactVideoView.Set_IsLoopingEnabled(propertyValue.AsBoolean());
} else if (propertyName == "paused") {