A minimal sample application that uses the Pixel Streaming library in React.
- A minimal React application with a Pixel Streaming wrapper component
- Starts a Pixel Streaming session on wrapper component mount
- Disconnects the session on wrapper component unmount e.g. if navigating to another view in a single page app
- Hooks to
playStreamRejectedevent and displays aClick to playoverlay if the browser rejects video stream auto-play
To build and run the React application, run:
npm installnpm run build-allnpm run serve
Webpack outputs this bundle to Frontend/implementations/react/dist/ (rather than SignallingWebServer/www/, which is reserved for the TypeScript reference frontend). To have Wilbur serve the React bundle, pass its path via --http_root:
# Build the React bundle, then start Wilbur pointed at it
npm run build --workspace Frontend/implementations/react
./SignallingWebServer/platform_scripts/bash/start.sh \
--http_root="$(pwd)/Frontend/implementations/react/dist"If you want webpack to write somewhere else (for example, to drop the bundle directly into a deploy directory), set WEBPACK_OUTPUT_PATH before running the build.