├── .gitignore ├── LICENSE ├── README.md ├── build_electron.cmd ├── build_electron.sh ├── electron_main.js ├── index.html ├── package.json ├── run_electron.cmd └── run_electron.sh /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Sergey Radionov 4 | Copyright (c) 2015 Ivo Georgiev 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wcjs-ugly-demo 2 | basic demo for WebChimera.js 3 | 4 | # Use with `WebChimera.js` prebuilt 5 | 6 | ### Windows 7 | * run `git clone https://github.com/RSATom/wcjs-ugly-demo.git` 8 | * run `npm install --ignore-scripts` 9 | * download `WebChimera.js_*_VLC_*_win.zip` corresponding to your engine from [WebChimera.js releases page](https://github.com/RSATom/WebChimera.js/releases) and extract to `node_modules` 10 | * run `run_*.cmd` 11 | 12 | ### Mac OS X 13 | * `git clone https://github.com/RSATom/wcjs-ugly-demo.git` 14 | * run `npm install --ignore-scripts` 15 | * download `WebChimera.js_*_osx.tar.gz` corresponding to your engine from [WebChimera.js releases page](https://github.com/RSATom/WebChimera.js/releases) and extract to `node_modules` 16 | * run `run_*.sh` 17 | 18 | ### Linux 19 | * install `VLC` (for apt based distros: `sudo apt-get install vlc` or `sudo apt-get install vlc-nox`) 20 | * `git clone https://github.com/RSATom/wcjs-ugly-demo.git` 21 | * run `npm install --ignore-scripts` 22 | * download `WebChimera.js_*_linux.zip` corresponding to your engine from [WebChimera.js releases page](https://github.com/RSATom/WebChimera.js/releases) and extract to `node_modules\webchimera.js\Release` 23 | * run `run_*.sh` 24 | 25 | # Use with `WebChimera.js` build from sources 26 | * [WebChimera.js build prerequisites](https://github.com/RSATom/WebChimera.js#build-prerequisites) 27 | 28 | ### Get sources 29 | * `git clone https://github.com/RSATom/wcjs-ugly-demo.git` 30 | * `cd wcjs-ugly-demo` 31 | 32 | ### Electron build & run 33 | * `npm install -g electron` 34 | * `build_electron.cmd` 35 | * `run_electron.cmd` 36 | -------------------------------------------------------------------------------- /build_electron.cmd: -------------------------------------------------------------------------------- 1 | set npm_config_wcjs_runtime="electron" 2 | set npm_config_wcjs_runtime_version="12.0.6" 3 | set npm_config_wcjs_arch="x64" 4 | rem set npm_config_wcjs_arch="ia32" 5 | 6 | npm install 7 | -------------------------------------------------------------------------------- /build_electron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export npm_config_wcjs_runtime="electron" 4 | export npm_config_wcjs_runtime_version="12.0.6" 5 | 6 | npm install 7 | -------------------------------------------------------------------------------- /electron_main.js: -------------------------------------------------------------------------------- 1 | // compatible with both Electron 0.x and 1.x 2 | try { 3 | var BrowserWindow = require("browser-window"); 4 | } catch(err) { 5 | var BrowserWindow = require("electron").BrowserWindow; 6 | } 7 | 8 | // compatible with both Electron 0.x and 1.x 9 | try { 10 | var app = require("app"); 11 | } catch(err) { 12 | var app = require("electron").app; 13 | } 14 | 15 | if(process.platform == 'win32') 16 | process.env['VLC_PLUGIN_PATH'] = require('path').join(__dirname, 'node_modules/webchimera.js/plugins'); 17 | 18 | app.on("ready", function() { 19 | var win = new BrowserWindow({ 20 | webPreferences: { 21 | nodeIntegration: true, 22 | contextIsolation: false, 23 | } 24 | }); 25 | win.toggleDevTools(); 26 | win.loadURL("file://" + __dirname + "/index.html"); 27 | }) 28 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ugly", 3 | "description": "basic demo for WebChimera.js", 4 | "version": "0.2.0", 5 | "private": true, 6 | "main": "index.html", 7 | "dependencies": { 8 | "webchimera.js": "*", 9 | "webgl-video-renderer": ">=0.2.0" 10 | }, 11 | "cmake-js": { 12 | "runtime": "nw", 13 | "runtimeVersion": "0.16.0" 14 | }, 15 | "env": "development" 16 | } 17 | -------------------------------------------------------------------------------- /run_electron.cmd: -------------------------------------------------------------------------------- 1 | electron ./electron_main.js 2 | -------------------------------------------------------------------------------- /run_electron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | electron ./electron_main.js 4 | --------------------------------------------------------------------------------