Skip to content

Commit

Permalink
Add support for react-native Windows Cpp/WinRT (#1893)
Browse files Browse the repository at this point in the history
This also deprecates the old react-native windows implementation
  • Loading branch information
ddalp authored Feb 25, 2020
1 parent 4f07aab commit a4fec8e
Show file tree
Hide file tree
Showing 34 changed files with 780 additions and 1,553 deletions.
48 changes: 15 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,52 +184,34 @@ protected List<ReactPackage> getPackages() {

### Windows installation
<details>
<summary>Windows details</summary>
<summary>Windows RNW C++/WinRT details</summary>

Make the following additions to the given files manually:

#### **windows/myapp.sln**

Add the `ReactNativeVideo` project to your solution.
Add the `ReactNativeVideoCPP` project to your solution.

1. Open the solution in Visual Studio 2015
1. Open the solution in Visual Studio 2019
2. Right-click Solution icon in Solution Explorer > Add > Existing Project
* UWP: Select `node_modules\react-native-video\windows\ReactNativeVideo\ReactNativeVideo.csproj`
* WPF: Select `node_modules\react-native-video\windows\ReactNativeVideo.Net46\ReactNativeVideo.Net46.csproj`
Select `node_modules\react-native-video\windows\ReactNativeVideoCPP\ReactNativeVideoCPP.vcxproj`

#### **windows/myapp/myapp.csproj**
#### **windows/myapp/myapp.vcxproj**

Add a reference to `ReactNativeVideo` to your main application project. From Visual Studio 2015:
Add a reference to `ReactNativeVideoCPP` to your main application project. From Visual Studio 2019:

1. Right-click main application project > Add > Reference...
* UWP: Check `ReactNativeVideo` from Solution Projects.
* WPF: Check `ReactNativeVideo.Net46` from Solution Projects.
Check `ReactNativeVideoCPP` from Solution Projects.

#### **MainPage.cs**
2. Modify files below to add the video package providers to your main application project
#### **pch.h**

Add `#include "winrt/ReactNativeVideoCPP.h"`.

#### **app.cpp**

Add `PackageProviders().Append(winrt::ReactNativeVideoCPP::ReactPackageProvider());` before `InitializeComponent();`.

Add the `ReactVideoPackage` class to your list of exported packages.
```cs
using ReactNative;
using ReactNative.Modules.Core;
using ReactNative.Shell;
using ReactNativeVideo; // <-- Add this
using System.Collections.Generic;
...

public override List<IReactPackage> Packages
{
get
{
return new List<IReactPackage>
{
new MainReactPackage(),
new ReactVideoPackage(), // <-- Add this
};
}
}

...
```
</details>

### react-native-dom installation
Expand Down
36 changes: 0 additions & 36 deletions windows/ReactNativeVideo.Net46/Properties/AssemblyInfo.cs

This file was deleted.

74 changes: 0 additions & 74 deletions windows/ReactNativeVideo.Net46/ReactNativeVideo.Net46.csproj

This file was deleted.

15 changes: 0 additions & 15 deletions windows/ReactNativeVideo.Net46/ReactVideoEventType.cs

This file was deleted.

36 changes: 0 additions & 36 deletions windows/ReactNativeVideo.Net46/ReactVideoEventTypeExtensions.cs

This file was deleted.

30 changes: 0 additions & 30 deletions windows/ReactNativeVideo.Net46/ReactVideoPackage.cs

This file was deleted.

Loading

0 comments on commit a4fec8e

Please sign in to comment.