--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/5d652bf3-e82c-4cca-877d-0a3a2d594c6c%40googlegroups.com.
http://username:password@xxx.xxx.xxx.xxx:yyyy/SnapshotJPEG?Resolution=320x240&Quality=HighSeems that credentials embedded in an URL is not possible anymore in Chrome, for security reasons....
<table width="310" cellpadding="3" cellspacing="0" align="center" style="background-color:#313131;">
<tr>
<td>
<iframe src="http://username:pass...@xxx.xxx.xxx.xxx:yyyy/SnapshotJPEG?Resolution=320x240&Quality=High" width="320px" height="240px"></iframe>
</td>
</tr>
</table><html> <center> <table border="2" width="25%" height="30%"> <!-- put the up address of your Pi's in this line: --> <tr><!-- Row 1 --> <td style="text-align: center"><img src="http://192.168.10.237:8082/" width="500px"/></td> <td style="text-align: center"><img src="http://192.168.10.238:8081/" width="500px"/></td> <td style="text-align: center"><img src="http://192.168.10.238:8082/" width="500px"/></td> </tr> <tr><!-- Row 2 --> <td style="text-align: center"><img src="http://192.168.10.236:8081/" width="500px"/></td> <td style="text-align: center"><img src="http://192.168.10.236:8082/" width="500px"/></td> <td style="text-align: center"><img src="http://192.168.10.237:8081/" width="500px"/></td> </tr> </table> </center></html>--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/0b4d8748-84bd-4dc2-9809-8a767526f80a%40googlegroups.com.
For me I enter the ip address into a template node which then feeds into a ui_template node, if I remember correctly that solves the blocked origin issue.
[{"id":"668e3038.f4cb8","type":"ui_template","z":"869383b9.3fcfa","group":"3ebadd64.abb2f2","name":"video feed 192","order":1,"width":"6","height":"4","format":"<!DOCTYPE html>\n <table width=\"310\" height=\"210\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" style=\"background-color:#313131\" >\n <tr>\n <td> <div ng-bind-html=\"msg.payload\"></div> </td>\n </tr>\n </table>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1100,"y":640,"wires":[[]]},{"id":"7bd9f1dd.87d17","type":"template","z":"869383b9.3fcfa","name":"send ip","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"\n<img width=\"300\" height=\"200\" src=\"http://192.168.0.192:8001/?action=stream\">","output":"str","x":908,"y":669,"wires":[["668e3038.f4cb8"]]},{"id":"8c11ff10.9a8ec","type":"template","z":"869383b9.3fcfa","name":"send null","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"\n<img alt=\"Rear Camera Off\">","output":"str","x":911,"y":609,"wires":[["668e3038.f4cb8"]]},{"id":"86abfed1.8df6d","type":"inject","z":"869383b9.3fcfa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":720,"y":620,"wires":[["8c11ff10.9a8ec"]]},{"id":"d6853d6.c97ebc","type":"inject","z":"869383b9.3fcfa","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":720,"y":680,"wires":[["7bd9f1dd.87d17"]]},{"id":"3ebadd64.abb2f2","type":"ui_group","z":"","name":"Rear cam 192 sm","tab":"42f866bf.8a5ca8","order":17,"disp":false,"width":"6","collapse":false},{"id":"42f866bf.8a5ca8","type":"ui_tab","z":"","name":"Control","icon":"dashboard","order":3}]
On Mar 27, 2018, at 9:01 PM, timothym...@gmail.com wrote:
This is what happens:
Reason is that my dashboard connects via a secure https connection to my Node-Red flow, and now I want to open in the same session an unsecure http connection to my camera.
So I don't think it is a good a idea to pass the credentials (in any way) to your dashboard.
Just use a HttpRequest node (where your credentials are 'rather' safe) to get the camera image, and push the image to the 'img' tag on your dashboard.
But anyway, you posted a very intriguing question ;-)
Bart
[{"id":"72abc50b.3647bc","type":"ui_template","z":"47b91ceb.38a754","group":"16a1f12d.07c69f","name":"Dynamic img src request","order":1,"width":"6","height":"4","format":"<script> \n (function(scope) {\n // Handle input messages\n scope.$watch('msg', function (msg) {\n if(!msg) {\n return;\n }\n //debugger;\n var xhr = new XMLHttpRequest();\n xhr.responseType = 'blob'; //so you can access the response like a normal URL\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE && xhr.status == 200) {\n var img = document.createElement('img');\n img.src = URL.createObjectURL(xhr.response); //create <img> with src set to the blob\n \n var cellElement = document.getElementById('cellId');\n cellElement.appendChild(img);\n }\n };\n xhr.open('GET', msg.url, true);\n xhr.setRequestHeader(msg.username, msg.password);\n xhr.send();\n }); \n })(scope); \n</script>\n\n<table width=\"310\" height=\"210\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" style=\"background-color:#313131\" >\n <tr>\n <td id=\"cellId\"></td>\n </tr>\n</table>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":750,"y":1860,"wires":[[]]},{"id":"4c90cdbd.5a2d44","type":"change","z":"47b91ceb.38a754","name":"Set url and credentials","rules":[{"t":"set","p":"url","pt":"msg","to":"your_url","tot":"str"},{"t":"set","p":"username","pt":"msg","to":"your_username","tot":"str"},{"t":"set","p":"password","pt":"msg","to":"your_password","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1860,"wires":[["72abc50b.3647bc"]]},{"id":"402bbd4.61db044","type":"inject","z":"47b91ceb.38a754","name":"Send data","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":1860,"wires":[["4c90cdbd.5a2d44"]]},{"id":"16a1f12d.07c69f","type":"ui_group","z":"","name":"Default","tab":"f136a522.adc2a8","order":1,"disp":true,"width":"6"},{"id":"f136a522.adc2a8","type":"ui_tab","z":"","name":"Home","icon":"home","order":1}]Does it make any difference that the raspberry Pi camera, using raspi web cam as the software to run it, doesn't require a password or user name?
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/3f4db981-d74f-472a-bd90-2420617d3078%40googlegroups.com.
My apologies for asking such a rudimentary question, but I have tried every variation I can think of from the examples given here. My Pi streams video as html, at a web address that I can view on my local net, using the RPI Web Cam interface software. No passwords involved in logging in. I tried using a node red function to embed the html details, but I can't get it to work. I can't even get a frame to appear on my dashboard, let alone stream video onto it.Thanks, in advance,Tim