MNDOT cameras _do_ expose a source!
Co-Authored-By: Eric Villnow <villnoweric@gmail.com>
This commit is contained in:
parent
5d39ee481e
commit
7fbb7a426a
|
@ -40,9 +40,17 @@ for c in camera_views:
|
||||||
print(c)
|
print(c)
|
||||||
raise Exception(f"Unexpected number of features: {len(c['features'])}")
|
raise Exception(f"Unexpected number of features: {len(c['features'])}")
|
||||||
|
|
||||||
if re.match(r"Show [\d]* cameras", c['tooltip']):
|
if re.match(r"Show .* cameras", c['tooltip']):
|
||||||
raise Exception(f"Not zoomed in enough! Finding aggregate cameras: {c}")
|
raise Exception(f"Not zoomed in enough! Finding aggregate cameras: {c}")
|
||||||
|
|
||||||
|
for view in c['views']:
|
||||||
|
if len(view['sources']) != 1 if view['category'] == 'VIDEO' else 0:
|
||||||
|
print(view)
|
||||||
|
raise Exception(f"Unexpected number of sources ({len(view['sources'])})")
|
||||||
|
for source in view['sources'] or []:
|
||||||
|
if source['type'] != 'application/x-mpegURL':
|
||||||
|
raise Exception(f"Unexpected type {source['type']}")
|
||||||
|
|
||||||
viewCount += len(c['views'])
|
viewCount += len(c['views'])
|
||||||
cameras.append({
|
cameras.append({
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
|
|
|
@ -39,9 +39,7 @@ vectorLayer.customPopupCallback = function(feature) {
|
||||||
if (view.category.toLowerCase() == "video") {
|
if (view.category.toLowerCase() == "video") {
|
||||||
const video = document.getElementById('popupVideo');
|
const video = document.getElementById('popupVideo');
|
||||||
|
|
||||||
const videoID = view.url.split('/').pop();
|
const videoSrc = view.sources[0].src;
|
||||||
|
|
||||||
const videoSrc = `https://video.dot.state.mn.us/public/${videoID}.stream/playlist.m3u8`;
|
|
||||||
if (Hls.isSupported()) {
|
if (Hls.isSupported()) {
|
||||||
var hls = new Hls();
|
var hls = new Hls();
|
||||||
hls.loadSource(videoSrc);
|
hls.loadSource(videoSrc);
|
||||||
|
|
|
@ -18,6 +18,11 @@ query MapFeatures($input: MapFeaturesArgs!, $plowType: String) {
|
||||||
uri
|
uri
|
||||||
... on CameraView {
|
... on CameraView {
|
||||||
url
|
url
|
||||||
|
sources {
|
||||||
|
type
|
||||||
|
src
|
||||||
|
}
|
||||||
|
title
|
||||||
}
|
}
|
||||||
category
|
category
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue