React Native Windows updates (#2206)

Various updates for React Native Windows

**Docs**
* Fixed windows installation in readme
* Added local dev setup instructions

**Build**
* Added VS solutions for RNW 0.61, 0.62, and 0.63+
* Added clang-formatting definition

**Features**
* Fixed autolinking for RNW 0.63+
* Added support for `rate` property

**Examples**
* Upgraded examples/basic to RN 0.61 and replaced broken windows app
This commit is contained in:
Jon Thysell
2021-04-08 10:37:35 -07:00
committed by GitHub
parent 3dc607c461
commit d7ac23d39b
52 changed files with 2675 additions and 1329 deletions

View File

@@ -49,6 +49,7 @@ IMapView<hstring, ViewManagerPropertyType> ReactVideoViewManager::NativeProps()
nativeProps.Insert(L"controls", ViewManagerPropertyType::Boolean);
nativeProps.Insert(L"fullscreen", ViewManagerPropertyType::Boolean);
nativeProps.Insert(L"progressUpdateInterval", ViewManagerPropertyType::Number);
nativeProps.Insert(L"rate", ViewManagerPropertyType::Number);
return nativeProps.GetView();
}
@@ -64,28 +65,30 @@ void ReactVideoViewManager::UpdateProperties(
auto const &propertyValue = pair.second;
if (!propertyValue.IsNull()) {
if (propertyName == "src") {
auto const &srcMap = propertyValue.AsObject();
auto const &uri = srcMap.at("uri");
reactVideoView.Set_UriString(to_hstring(uri.AsString()));
auto const &srcMap = propertyValue.AsObject();
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())));
reactVideoView.Stretch(static_cast<Stretch>(std::stoul(propertyValue.AsString())));
} else if (propertyName == "repeat") {
reactVideoView.Set_IsLoopingEnabled(propertyValue.AsBoolean());
reactVideoView.Set_IsLoopingEnabled(propertyValue.AsBoolean());
} else if (propertyName == "paused") {
m_paused = propertyValue.AsBoolean();
reactVideoView.Set_Paused(m_paused);
m_paused = propertyValue.AsBoolean();
reactVideoView.Set_Paused(m_paused);
} else if (propertyName == "muted") {
reactVideoView.Set_Muted(propertyValue.AsBoolean());
reactVideoView.Set_Muted(propertyValue.AsBoolean());
} else if (propertyName == "volume") {
reactVideoView.Set_Volume(propertyValue.AsDouble());
reactVideoView.Set_Volume(propertyValue.AsDouble());
} else if (propertyName == "seek") {
reactVideoView.Set_Position(propertyValue.AsDouble());
reactVideoView.Set_Position(propertyValue.AsDouble());
} else if (propertyName == "controls") {
reactVideoView.Set_Controls(propertyValue.AsBoolean());
reactVideoView.Set_Controls(propertyValue.AsBoolean());
} else if (propertyName == "fullscreen") {
reactVideoView.Set_FullScreen(propertyValue.AsBoolean());
reactVideoView.Set_FullScreen(propertyValue.AsBoolean());
} else if (propertyName == "progressUpdateInterval") {
reactVideoView.Set_ProgressUpdateInterval(propertyValue.AsInt64());
reactVideoView.Set_ProgressUpdateInterval(propertyValue.AsInt64());
} else if (propertyName == "rate") {
reactVideoView.Set_PlaybackRate(propertyValue.AsDouble());
}
}
}