Clean up HLS stream
Without this, it will continue loading chunks in the background.
This commit is contained in:
parent
572a8c6d3c
commit
acad9c5944
|
@ -62,6 +62,7 @@ for (let [state, url] of Object.entries(allStates)) {
|
||||||
var hls = new Hls();
|
var hls = new Hls();
|
||||||
hls.loadSource(view.src);
|
hls.loadSource(view.src);
|
||||||
hls.attachMedia(video);
|
hls.attachMedia(video);
|
||||||
|
vectorLayer.destroyPopupCallback = () => hls.destroy();
|
||||||
}
|
}
|
||||||
// iDevice support, untested (only works in Safari; required for iPhones)
|
// iDevice support, untested (only works in Safari; required for iPhones)
|
||||||
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||||
|
|
15
main.js
15
main.js
|
@ -23,12 +23,6 @@ const popupOverlay = new Overlay({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
closer.onclick = function () {
|
|
||||||
popupOverlay.setPosition(undefined);
|
|
||||||
closer.blur();
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const contextMenu = new ContextMenu({
|
const contextMenu = new ContextMenu({
|
||||||
width: 170,
|
width: 170,
|
||||||
defaultItems: false,
|
defaultItems: false,
|
||||||
|
@ -147,6 +141,15 @@ map.on('click', function (evt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
popupOverlay.setPosition(evt.coordinate);
|
popupOverlay.setPosition(evt.coordinate);
|
||||||
|
|
||||||
|
closer.onclick = function (){
|
||||||
|
popupOverlay.setPosition(undefined);
|
||||||
|
if (layer.hasOwnProperty('destroyPopupCallback')) {
|
||||||
|
layer.destroyPopupCallback(feature);
|
||||||
|
}
|
||||||
|
closer.blur();
|
||||||
|
return false;
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
new ResizeObserver(() => map.updateSize()).observe(document.getElementById("map"));
|
new ResizeObserver(() => map.updateSize()).observe(document.getElementById("map"));
|
||||||
|
|
Loading…
Reference in a new issue