Skip to content
Snippets Groups Projects
Commit b1e5ea18 authored by 42loop's avatar 42loop
Browse files

added some style, fixed 'current' display

parent 82824cb8
Branches
No related tags found
No related merge requests found
......@@ -122,7 +122,7 @@ function noimage(sender)
});
getimages();
setTimeout(() => { sender.style.background="darkgray"; }, 500);
document.getElementById("currentimage").innerHTML="";
}
......@@ -139,7 +139,7 @@ function novideo(sender)
});
getvideos();
setTimeout(() => { sender.style.background="darkgray"; }, 500);
document.getElementById("currentvideo").innerHTML="";
}
function setcron()
......
......@@ -18,6 +18,8 @@
padding:10px;
height:20px;
width:42px;
border-style: solid;
border-radius: 5px;
}
.selectmedia {
......
......@@ -283,7 +283,10 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
return
elif page == '/novideo':
print("have novideo")
os.system("pkill -f omxplayer")
os.system("rm /home/pi/video/*")
currentvideo=""
return
......@@ -291,6 +294,7 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
print("have noimage")
currentimage=""
os.system("pkill -f pngview")
os.system("rm /home/pi/image/*")
return
elif page == '/getcurrent':
......@@ -298,8 +302,13 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
self.send_response(200)
self.send_header('Content-type','text/plain; charset=UTF-8')
self.end_headers()
currentvideo=""
currentimage=""
try:
currentimage=os.listdir("/home/pi/image")[0]
currentvideo=os.listdir("/home/pi/video")[0]
except:
pass
self.wfile.write(bytes((currentimage+"|"+currentvideo),encoding='utf8'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment