thay doi tinh nang chay trong mang noi bo

This commit is contained in:
2026-04-27 22:05:18 +07:00
parent a89e145497
commit 0de7d67511
8 changed files with 146 additions and 41 deletions
+7 -1
View File
@@ -147,7 +147,13 @@ export function useWhepPlayer({
const answerSdp = await res.text();
const location = res.headers.get("location") || res.headers.get("Location");
if (location) sessionUrlRef.current = location;
if (location) {
try {
sessionUrlRef.current = new URL(location, whepUrl).toString();
} catch {
sessionUrlRef.current = location;
}
}
await pc.setRemoteDescription({ type: "answer", sdp: answerSdp });
if (!disposed) setStatus("playing");