- Add the next dependency in
package.json
manually (since it's not NPM registered module)
"dependencies": {
...
"react-native-nm-video": "git+https://github.com/NoriginMedia/react-native-nm-video.git"
...
}
-
run
npm install
-
run
react-native link
so the lib will be automagically linked to your react-native iOS and Android projects -
in JS:
import Video from "react-native-nm-video";
...
<Video {...props} />
-
clone the repo
[email protected]:NoriginMedia/react-native-nm-video.git
-
run
npm install
in the root folder (installs ESLint etc.) -
cd /examples
-
run
npm install
inexamples
folder (installs react-native for local testing in the empty project) -
run
react-native link
so thereact-native-nm-video
package get linked to yourexample
subproject for iOS and Android automatically
-
open Android Emulator
-
in
example
folder runnpm run start:android
. Orstart:android
task from your IDE npm scripts window -
after the changes made to native code, run
npm run reinstall
to reinstall dependency with updated code. -
start:android
again to rebuild with updated native code. -
Official guide on native UI modules: here
-
Standard
<Video />
component offered by the community that might be used as an example: here
-
in
example
folder runnpm run start:ios
. Orstart:ios
task from your IDE npm scripts window -
after the changes made to native code, run
npm run reinstall
to reinstall dependency with updated code. -
start:ios
again to rebuild with updated native code. -
Official guide on native UI modules: here
-
Standard
<Video />
component offered by the community that might be used as an example: here
-
examples
subproject has a dependency on the outer folder package (which is `react-native-nm-video itself) for testing -
examples/index.<ios|android>.js
is an entry point to the app for respective platform. -
Video.js
is a React component that requires native component named RCTNMVideo (React Norigin Media Video). -
Sources for native modules are in respective folders,
android
andios
. -
example
folder is excluded when installing package in some external project (see.npmignore
)