Skip to content

Commit fa24799

Browse files
Merge pull request #4301 from IgorA100/patch-76
Fix: Problem with long page opening in Firefox Montage page
2 parents 2b7fed4 + 63dcb76 commit fa24799

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

web/skins/classic/views/js/montage.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,21 @@ function handleClick(evt) {
538538
function startMonitors() {
539539
for (let i = 0, length = monitors.length; i < length; i++) {
540540
const monitor = monitors[i];
541+
// Why are we scaling here instead of in monitorstream?
542+
/* +++ If you delete this code, then Firefox will slow down terribly... you need to UNDERSTAND the problem!!!*/
543+
const obj = document.getElementById('liveStream'+monitor.id);
544+
if (obj) {
545+
if (obj.src) {
546+
const url = new URL(obj.src);
547+
let scale = parseInt(obj.clientWidth / monitor.width * 100);
548+
if (scale > 100) scale = 100;
549+
url.searchParams.set('scale', scale);
550+
obj.src = url;
551+
}
552+
} else {
553+
console.log(`startMonitors NOT FOUND ${'liveStream'+monitor.id}`);
554+
}
555+
/* --- */
541556
const isOut = isOutOfViewport(monitor.getElement());
542557
if (!isOut.all) {
543558
monitor.start();

0 commit comments

Comments
 (0)