Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ginberg/webcamR
Htmlwidget wrapper around the react-webcam library.
https://github.com/ginberg/webcamR
Last synced: 28 days ago
JSON representation
Htmlwidget wrapper around the react-webcam library.
- Host: GitHub
- URL: https://github.com/ginberg/webcamR
- Owner: ginberg
- Created: 2019-01-29T09:42:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-31T05:19:22.000Z (almost 6 years ago)
- Last Synced: 2024-05-02T02:25:07.897Z (8 months ago)
- Language: R
- Homepage:
- Size: 81.1 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-shiny-extensions - webcamR - HTML widget wrapper around the react-webcam library. (UI Components / Image / Audio / Video)
README
# Webcam HTMLWidget
This example demonstrates creating an [htmlwidget](https://www.htmlwidgets.org/) wrapper around the [react-webcam](https://www.npmjs.com/package/react-webcam) library.
# Building
Because this package includes Javascript source code that requires a compilation step, package installation is in two phases: Javascript tools build the Javascript, and R tools build and install the package. The R package includes the built Javascript files in the `inst/` directory.
## Javascript Build Requirements
Building Javascript should work on macOS, Linux, and Windows. The following tools are necessary regardless of your platform:
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/en/)## R Build Requirements
You should install the `reactR` package if you haven't, as this widget depends on it.
## Development Workflow
After you've installed Node.js and Yarn, run the following command to resolve and download dependencies:
```
yarn install
```Now, run `yarn` to build `inst/htmlwidgets/webcamR.js`:
```
yarn run webpack --mode=development
```> To run `yarn webpack` automatically whenever sources change, use the command `yarn run webpack --mode=development --watch`
Now that the Javascript is built, you can install the R package:
```
devtools::document()
devtools::install()
```Finally you can try the example app by running [app.R](app.R).