[mirotalksfu] - add video zoom on cursor position

هذا الالتزام موجود في:
Miroslav Pejic
2023-10-13 17:53:30 +02:00
الأصل 804ba07947
التزام 4e58a07a3b
5 ملفات معدلة مع 67 إضافات و17 حذوفات

عرض الملف

@@ -54,6 +54,8 @@ function resizeVideoMedia() {
Width = Width - bigWidth;
}
resetZoom();
// loop (i recommend you optimize this)
let i = 1;
while (i < 5000) {
@@ -70,6 +72,14 @@ function resizeVideoMedia() {
document.documentElement.style.setProperty('--vmi-wh', max / 3 + 'px');
}
function resetZoom() {
const videoElements = document.querySelectorAll('video');
videoElements.forEach((video) => {
video.style.transform = '';
video.style.transformOrigin = 'center';
});
}
function setWidth(Cameras, width, bigWidth, margin, maxHeight, isOneVideoElement) {
ratio = customRatio ? 0.68 : ratio;
for (let s = 0; s < Cameras.length; s++) {