Hello, sorry I was out this weekend.
Of course, here is my json code :
[{"id":"4f45bd28.fe7ea4","type":"http in","z":"310ea8f8.e72128","name":"","url":"/stream","method":"get","upload":false,"swaggerDoc":"","x":230,"y":120,"wires":[["1db9868.3f9a7fa","2a94f37ec98316e7"]]},{"id":"fc8f27e5.3f4af","type":"http response","z":"310ea8f8.e72128","name":"","statusCode":"","headers":{},"x":630,"y":120,"wires":[]},{"id":"1db9868.3f9a7fa","type":"template","z":"310ea8f8.e72128","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"plain","template":"<html>\n<head>\n <title>Streamer</title>\n</head>\n<body>\n <video autoplay></video>\n <script>\n // get video dom element\n const server = window.location.hostname;\n const video = document.querySelector('video');\n \n // request access to webcam\n navigator.mediaDevices.getUserMedia({video: {width: 360, height: 240}}).then((stream) => video.srcObject = stream);\n \n // returns a frame encoded in base64\n const getFrame = () => {\n const canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0);\n const data = canvas.toDataURL('image/png');\n return data;\n }\n\n const WS_URL = `ws://${server}:1880/ws/cam`;\n console.log(WS_URL);\n const FPS = 10;\n const ws = new WebSocket(WS_URL);\n ws.onopen = () => {\n console.log(`Connected to ${WS_URL}`);\n setInterval(() => {\n ws.send(getFrame());\n }, 1000 / FPS);\n }\n </script>\n</body>\n</html>","output":"str","x":460,"y":160,"wires":[["fc8f27e5.3f4af"]]},{"id":"15b57638.12e582","type":"websocket in","z":"310ea8f8.e72128","name":"","server":"524d85f.8ebbc7c","client":"","x":230,"y":220,"wires":[["63433a007dae4ca1"]]},{"id":"e7cc856b.d2f17","type":"comment","z":"310ea8f8.e72128","name":"http://192.168.1.97:81/stream>","info":"Go to <http://192.168.1.97:81/stream>","x":290,"y":60,"wires":[]},{"id":"2a94f37ec98316e7","type":"debug","z":"310ea8f8.e72128","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":540,"y":40,"wires":[]},{"id":"63433a007dae4ca1","type":"debug","z":"310ea8f8.e72128","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":520,"y":280,"wires":[]},{"id":"524d85f.8ebbc7c","type":"websocket-listener","path":"/ws/cam","wholemsg":"false"}]
Today, I can use VLC to read the video on this http.
Thank you in advance,
Regards,
Samuel