applyQualityForNetwork method

void applyQualityForNetwork(
  1. String networkType
)

Ajusta resolución y tasa de refresco según el tipo de conexión ('wifi', '4g', '3g', '2g')

Implementation

void applyQualityForNetwork(String networkType) {
  switch (networkType.toLowerCase().trim()) {
    case 'wifi':
    case 'ethernet':
    case '5g':
      videoWidth = 1280;
      videoHeight = 720;
      videoFrameRate = 30;
      break;
    case '4g':
    case 'lte':
      videoWidth = 1280;
      videoHeight = 720;
      videoFrameRate = 24;
      break;
    case '3g':
    case 'hspa':
    case 'umts':
      videoWidth = 854;
      videoHeight = 480;
      videoFrameRate = 15;
      break;
    case '2g':
    case 'gprs':
    case 'edge':
      videoWidth = 480;
      videoHeight = 360;
      videoFrameRate = 10;
      break;
    default:
      // Mantener valores actuales
      break;
  }
  log('📶 Calidad WebRTC ajustada para [$networkType]: ${videoWidth}x$videoHeight @ ${videoFrameRate}fps');
}