log优化
This commit is contained in:
@@ -23,6 +23,9 @@ import {
|
||||
renderParticipantStreamMedia,
|
||||
renderSingleRemoteStreamMedia
|
||||
} from './renderer-media.js';
|
||||
import { createLogger } from './logger.js';
|
||||
|
||||
const logger = createLogger('renderer');
|
||||
|
||||
const GRID_LAYOUT = {
|
||||
maxColumns: 3,
|
||||
@@ -317,13 +320,13 @@ class UIRenderer {
|
||||
this.elements.localVideo.srcObject = stream;
|
||||
this.elements.localVideo.autoplay = true;
|
||||
this.elements.localVideo.muted = true;
|
||||
console.log('srcObject set successfully:', this.elements.localVideo.srcObject);
|
||||
logger.debug('srcObject set successfully:', this.elements.localVideo.srcObject);
|
||||
|
||||
if (this.elements.disconnectedOverlay) {
|
||||
this.elements.disconnectedOverlay.classList.add('hidden');
|
||||
}
|
||||
} else {
|
||||
console.error('Either localVideo element or stream is missing');
|
||||
logger.error('Either localVideo element or stream is missing');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +355,7 @@ class UIRenderer {
|
||||
const grid = this.elements.participantGrid;
|
||||
if (!grid) return;
|
||||
updateParticipantTilePlaceholder(grid, participantId, showPlaceholder);
|
||||
console.log(`Updated placeholder for participant ${participantId}: ${showPlaceholder ? 'shown' : 'hidden'}`);
|
||||
logger.debug(`Updated placeholder for participant ${participantId}: ${showPlaceholder ? 'shown' : 'hidden'}`);
|
||||
}
|
||||
|
||||
syncParticipantTileNames(participants) {
|
||||
@@ -369,7 +372,7 @@ class UIRenderer {
|
||||
if (!grid) return;
|
||||
syncParticipantTileName(grid, participantId, name);
|
||||
if (name) {
|
||||
console.log(`Updated tile name for participant ${participantId}: ${name}`);
|
||||
logger.debug(`Updated tile name for participant ${participantId}: ${name}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,13 +511,13 @@ class UIRenderer {
|
||||
}
|
||||
|
||||
renderCallEnded() {
|
||||
console.log('Call ended');
|
||||
logger.debug('Call ended');
|
||||
clearParticipantGrid(this.elements.participantGrid);
|
||||
window.location.href = './endcall/endcall.html';
|
||||
}
|
||||
|
||||
renderParticipantLeft(connectionId) {
|
||||
console.log(`Participant left: ${connectionId}, updating UI`);
|
||||
logger.debug(`Participant left: ${connectionId}, updating UI`);
|
||||
removeParticipantTile({
|
||||
grid: this.elements.participantGrid,
|
||||
connectionId,
|
||||
|
||||
Reference in New Issue
Block a user