MNDOT cameras _do_ expose a source!

Co-Authored-By: Eric Villnow <villnoweric@gmail.com>
This commit is contained in:
Chandler Swift 2024-01-29 20:05:35 -06:00
parent 5d39ee481e
commit 7fbb7a426a
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
3 changed files with 15 additions and 4 deletions

View file

@ -40,9 +40,17 @@ for c in camera_views:
print(c)
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}")
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'])
cameras.append({
"type": "Feature",

View file

@ -39,9 +39,7 @@ vectorLayer.customPopupCallback = function(feature) {
if (view.category.toLowerCase() == "video") {
const video = document.getElementById('popupVideo');
const videoID = view.url.split('/').pop();
const videoSrc = `https://video.dot.state.mn.us/public/${videoID}.stream/playlist.m3u8`;
const videoSrc = view.sources[0].src;
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);

View file

@ -18,6 +18,11 @@ query MapFeatures($input: MapFeaturesArgs!, $plowType: String) {
uri
... on CameraView {
url
sources {
type
src
}
title
}
category
}