Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UCC
webcams
Commits
02645398
Commit
02645398
authored
Dec 04, 2014
by
Mitchell Pomery
Browse files
Stops bvreaking w=for no apparant reason
parent
ec780f94
Changes
3
Show whitespace changes
Inline
Side-by-side
www/camera.php
View file @
02645398
...
@@ -2,16 +2,20 @@
...
@@ -2,16 +2,20 @@
$camera
=
'nocamera'
;
$camera
=
'nocamera'
;
if
(
isset
(
$_GET
[
'camera'
]))
if
(
isset
(
$_GET
[
'camera'
]))
$camera
=
$_GET
[
'camera'
];
$camera
=
$_GET
[
'camera'
];
$imagelocation
=
"../
../
"
;
$imagelocation
=
"../"
;
$file
=
$imagelocation
.
strtolower
(
$camera
)
.
".jpg"
;
$file
=
$imagelocation
.
strtolower
(
$camera
)
.
".jpg"
;
$statusfile
=
$imagelocation
.
strtolower
(
$camera
)
.
".status"
;
//echo $file;
//echo $file;
header
(
"Expires: "
.
gmdate
(
"D, d M Y H:i:s"
,
time
())
.
" GMT"
);
header
(
"Expires: "
.
gmdate
(
"D, d M Y H:i:s"
,
time
())
.
" GMT"
);
if
(
!
is_readable
(
$file
))
{
if
(
!
is_readable
(
$file
))
{
$file
=
"nocamera.jpg"
;
$file
=
"nocamera.jpg"
;
}
}
if
(
file_exists
(
$statusfile
))
usleep
(
250000
);
header
(
"Content-Type: image/jpeg"
);
header
(
"Content-Type: image/jpeg"
);
header
(
"Content-Length: "
.
filesize
(
$file
));
header
(
"Content-Length: "
.
filesize
(
$file
));
header
(
"Last-Modified: "
.
gmdate
(
"D, d M Y H:i:s"
,
filectime
(
$file
))
.
" GMT"
);
$fps
=
stat
(
$file
);
header
(
"Last-Modified: "
.
gmdate
(
"D, d M Y H:i:s"
,
$fps
[
9
])
.
" GMT"
);
$fp
=
fopen
(
$file
,
'rb'
);
$fp
=
fopen
(
$file
,
'rb'
);
fpassthru
(
$fp
);
fpassthru
(
$fp
);
fclose
(
$fp
);
fclose
(
$fp
);
...
...
www/webcam-overrides.css
View file @
02645398
...
@@ -33,7 +33,7 @@ body {
...
@@ -33,7 +33,7 @@ body {
}
}
.offline
{
.offline
{
opacity
:
0.1
;
/*
opacity: 0.1;
*/
}
}
/* Haven't touched anything below this */
/* Haven't touched anything below this */
...
...
www/webcams.js
View file @
02645398
function
windowOnload
()
function
windowOnload
()
{
{
updateTime
();
updateTime
();
setInterval
(
"
updateTime()
"
,
15000
);
setInterval
(
"
updateTime()
"
,
15000
);
}
}
function
updateWebcam
(
webcamid
,
webcamurl
)
function
updateWebcam
(
webcamid
,
webcamurl
)
...
@@ -37,13 +37,17 @@ function updateWebcam (webcamid, webcamurl)
...
@@ -37,13 +37,17 @@ function updateWebcam (webcamid, webcamurl)
{
{
var
imgdate
=
new
Date
(
Date
.
parse
(
req
.
getResponseHeader
(
"
Last-Modified
"
)));
var
imgdate
=
new
Date
(
Date
.
parse
(
req
.
getResponseHeader
(
"
Last-Modified
"
)));
var
servdate
=
new
Date
(
Date
.
parse
(
req
.
getResponseHeader
(
"
Date
"
)));
var
servdate
=
new
Date
(
Date
.
parse
(
req
.
getResponseHeader
(
"
Date
"
)));
if
(
Math
.
abs
(
imgdate
.
getTime
()
-
servdate
.
getTime
())
>
1000
*
60
*
2
)
if
(
Math
.
abs
(
imgdate
.
getTime
()
-
servdate
.
getTime
())
>
1000
*
60
*
3
)
{
{
console
.
log
(
"
Out Of Sync
"
);
console
.
log
(
"
imgdate:
"
+
imgdate
);
console
.
log
(
"
servdate:
"
+
servdate
);
// this image is out of date
// this image is out of date
img
.
classList
.
add
(
'
offline
'
);
img
.
classList
.
add
(
'
offline
'
);
}
}
else
else
{
{
//console.log("In Sync");
img
.
classList
.
remove
(
'
offline
'
);
img
.
classList
.
remove
(
'
offline
'
);
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment