Commit be4ae56c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix changing filter for a running stream.

parent 627061f0
...@@ -512,8 +512,15 @@ getSelectElement('filterselect').onchange = async function(e) { ...@@ -512,8 +512,15 @@ getSelectElement('filterselect').onchange = async function(e) {
if(!(this instanceof HTMLSelectElement)) if(!(this instanceof HTMLSelectElement))
throw new Error('Unexpected type for this'); throw new Error('Unexpected type for this');
updateSettings({filter: this.value}); updateSettings({filter: this.value});
// no need to reopen the camera let c = findUpMedia('camera');
replaceUpStreams('camera'); if(c) {
let filter = (this.value && filters[this.value]) || null;
if(filter)
c.userdata.filterDefinition = filter;
else
delete c.userdata.filterDefinition;
replaceUpStream(c);
}
}; };
/** @returns {number} */ /** @returns {number} */
...@@ -1235,9 +1242,9 @@ async function replaceUpStream(c) { ...@@ -1235,9 +1242,9 @@ async function replaceUpStream(c) {
let media = /** @type{HTMLVideoElement} */ let media = /** @type{HTMLVideoElement} */
(document.getElementById('media-' + c.localId)); (document.getElementById('media-' + c.localId));
setUpStream(cn, c.stream); setUpStream(cn, c.stream);
await setMedia(c, true, await setMedia(cn, true,
c.label == 'camera' && getSettings().mirrorView, cn.label == 'camera' && getSettings().mirrorView,
c.label == 'video' && media); cn.label == 'video' && media);
return cn; return cn;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment