An experiment to capture video on a HTML5 web app.
- Dev Ref: navigator.MediaDevices.getUserMedia()
- Tutorial: Taking still photos with WebRTC
- This is a web app built on HTML5, JavaScript and CSS.
- It uses Babel to transpile 'modern' ES6 code into 'current' (2016) JavaScript code.
- It uses Webpack to bundle JS files together. (Important for making the transpiled ES6 'import' functionality work.)
- Its also uses Stylus to make writing CSS easier.
- Developing the web app requires Node.js installed on your machine and a handy command line interface. (Bash, cmd.exe, etc)
- However, the compiled web app itself can be run simply by opening the
index.html
in a web browser. (Chrome, Firefox, etc)
Project anatomy:
- Source JS (ES6 JavaScript) and STYL (Stylus CSS) files are in the
/src
folder. - Compiled JS and CSS files are in the
/app
folder. - Media assets are meant to be placed in the
/assets
folder, but this is optional. - Entry point is
index.html
.
Starting the project:
- Install the project dependencies by running
npm install
- Run
npm start
to start the server. - Open
http://localhost:3000
on your browser to view the app.
Alternatively, there's a developer mode:
npm install
npm run dev
http://localhost:3000
- Changes to the JS and STYL files will now be compiled automatically; i.e. Babel/Webpack and Stylus now watch the files. Refreshing the browser window should should show the latest edits.