-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdemo-flow.json
1 lines (1 loc) · 2.5 KB
/
demo-flow.json
1
[{"id":"295d14ba.bdc25c","type":"component-camera","z":"97282828.a5e248","name":"Camera","unique":"camera1","x":99,"y":114,"wires":[["a44789fa.aaf0e8"]]},{"id":"a44789fa.aaf0e8","type":"debug","z":"97282828.a5e248","name":"","active":true,"console":"false","complete":"true","x":537,"y":114,"wires":[]},{"id":"d8f400ac.04c29","type":"http in","z":"97282828.a5e248","name":"","url":"/wcdemo","method":"get","upload":false,"swaggerDoc":"","x":119,"y":159,"wires":[["9fcebfc7.5a433"]]},{"id":"9fcebfc7.5a433","type":"template","z":"97282828.a5e248","name":"Styles","field":"payload.styles","fieldType":"msg","format":"css","syntax":"mustache","template":"html, body{width: 100%;height: 100%;padding: 0;margin: 0;}","output":"str","x":259,"y":159,"wires":[["f997ad7d.60cba"]]},{"id":"f997ad7d.60cba","type":"template","z":"97282828.a5e248","name":"JavaScript","field":"payload.script","fieldType":"msg","format":"javascript","syntax":"mustache","template":"(function(){'use strict';const el = document.querySelector('node-red-camera');console.log('el:', el);el.addEventListener('message', function(e){console.log('message event:', e);}, false);el.addEventListener('error', function(err){console.log('err:', err);}); el.addEventListener('streamavailable', function(data){console.log('streamavailable:', data);}); el.addEventListener('imageavailable', function(data){console.log('imageavailable:', data);}); el.addEventListener('videoavailable', function(data){console.log('videoavailable:', data);}); }());","output":"str","x":399,"y":159,"wires":[["e6a88701.fca4c8"]]},{"id":"e6a88701.fca4c8","type":"template","z":"97282828.a5e248","name":"HTML","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n <head>\n <title>Node-RED Web Components Demo</title>\n <script src=\"https://unpkg.com/@webcomponents/custom-elements\"></script>\n <script src=\"https://unpkg.com/@webcomponents/shadydom\"></script>\n <script src=\"/web-components/camera\"></script>\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=yes\" />\n <style>{{{payload.styles}}}</style>\n </head>\n <body>\n <node-red-camera data-nr-name=\"camera1\" data-nr-type=\"still\"></node-red-camera>\n <script>{{{payload.script}}}</script>\n </body>\n</html>","output":"str","x":539,"y":159,"wires":[["53669499.5ffbec"]]},{"id":"53669499.5ffbec","type":"http response","z":"97282828.a5e248","name":"","statusCode":"","headers":{},"x":661,"y":158,"wires":[]}]