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)
|
||||
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",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -18,6 +18,11 @@ query MapFeatures($input: MapFeaturesArgs!, $plowType: String) {
|
|||
uri
|
||||
... on CameraView {
|
||||
url
|
||||
sources {
|
||||
type
|
||||
src
|
||||
}
|
||||
title
|
||||
}
|
||||
category
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue