Video stream on Dashboard

1,155 views
Skip to first unread message

Arthur Azzopardi

unread,
Jun 14, 2017, 11:01:35 AM6/14/17
to Node-RED UI
I am a nubee on node-red.

I am trying to use node red to control a robot carrying a raspberry pi camera.  

Besides the control buttons to move the robot, pan/tilt camera etc, I have also added a video stream window by adding a template node to Dashboard with the code below:

<!DOCTYPE html>
<html>
    <head>
        <title>Camera Video Stream</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <script>
            function errorFunction() {
                alert('Stream stopped');
            }
        </script>
        <iframe width="288" height="216" img src= "http://192.168.0.71:8080/stream/video.mjpeg" alt="image"  >
    </body>
</html>

I would now like to be able to start/stop the display of this stream by adding a toggle button, but somehow I am stuck.  Have tried to go through various forums, etc, but it seems I am out of luck.

Any help would be appreciated.

Thanks in advance.

Glenn

unread,
Jun 17, 2017, 1:01:31 AM6/17/17
to Node-RED UI
I would ng-if or ng-show or ng-hide.

Send a payload which then makes that element hidden

Arthur Azzopardi

unread,
Jun 17, 2017, 7:30:32 AM6/17/17
to Node-RED UI
Thanks for your reply Glenn, but excuse my inexperience.  How do you do use ng-if/show/hide please?  Tried looking around.
Reply all
Reply to author
Forward
0 new messages