diff --git a/.env.local b/.env.local index 73b69a0..df88547 100644 --- a/.env.local +++ b/.env.local @@ -1,8 +1,9 @@ REACT_APP_CORE_URL=http://192.168.1.15:8080 REACT_APP_WHIP_BASE_URL=http://192.168.1.15:8555 -REACT_APP_YTDLP_URL=http://100.73.244.28:8080 +REACT_APP_YTDLP_URL=http://192.168.1.20:8282 REACT_APP_FB_SERVER_URL=http://localhost:3002 REACT_APP_LIVEKIT_API_KEY=APIBTqTGxf9htMK REACT_APP_LIVEKIT_API_SECRET=0dOHWPffwneaPg7OYpe4PeAes21zLJfeYJB9cKzSTtXW REACT_APP_LIVEKIT_WS_URL=wss://livekit-server.nextream.sytes.net REACT_APP_WHIP_SERVER_URL=https://djmaster.nextream.sytes.net +C \ No newline at end of file diff --git a/WHIP_UI_INTEGRATION_PROMPT.md b/WHIP_UI_INTEGRATION_PROMPT.md index a071b81..8976d53 100644 --- a/WHIP_UI_INTEGRATION_PROMPT.md +++ b/WHIP_UI_INTEGRATION_PROMPT.md @@ -600,6 +600,17 @@ Agregar un botón **"Ver en vivo"** / **"Preview"** en la tarjeta de cada stream async function startWHEPPreview(streamKey, whepBaseUrl) { const pc = new RTCPeerConnection({ iceServers: [] }) + // Set up the MediaStream BEFORE creating the offer so that ontrack fires + // correctly regardless of how fast ICE negotiation completes. + // Using a MediaStream instead of e.streams[0] avoids the common bug where + // e.streams is empty (no a=msid in SDP) and srcObject never gets set. + const mediaStream = new MediaStream() + videoElement.srcObject = mediaStream + + pc.ontrack = (e) => { + mediaStream.addTrack(e.track) + } + pc.addTransceiver('video', { direction: 'recvonly' }) pc.addTransceiver('audio', { direction: 'recvonly' }) @@ -627,11 +638,8 @@ async function startWHEPPreview(streamKey, whepBaseUrl) { await pc.setRemoteDescription({ type: 'answer', sdp: answerSDP }) // Mostrar video en el elemento