From bd0bfc501d218154b2077e99cce7e888adca4a91 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 4 Aug 2020 14:30:44 +0200 Subject: [PATCH] display battery stats --- raspberry/roberto/views/frontend/templates/index.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/raspberry/roberto/views/frontend/templates/index.html b/raspberry/roberto/views/frontend/templates/index.html index b4f89a1..852fe07 100644 --- a/raspberry/roberto/views/frontend/templates/index.html +++ b/raspberry/roberto/views/frontend/templates/index.html @@ -138,6 +138,15 @@ socket.on('data', (data) => { console.log('Data received: ',data); }); +socket.on('battery', (data) => { + console.log('Data received: ',data); + var canvas = document.getElementById("textoverlay"); + var ctx = canvas.getContext("2d"); + ctx.font = "24px Arial"; + ctx.fillStyle = "blue"; + ctx.fillText(data, canvas.width/3, 30); +}); + function playStream(videoElement, hostname, port, path, configuration, reportErrorCB) { var l = window.location; var wsHost = (hostname != undefined) ? hostname : l.hostname;