Skip to content

Commit

Permalink
Merge pull request #18 from Master2022E/17-warning-cleanup
Browse files Browse the repository at this point in the history
17 warning cleanup
  • Loading branch information
Thomsen96 authored Nov 22, 2022
2 parents 0423aa2 + 2a3cf93 commit b23d8a4
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 108 deletions.
30 changes: 15 additions & 15 deletions src/components/Location.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ const Location = () => {

return (
<div style={{ color: "#000000" }}>
<h1 class="ip">
<span class="text">IP: </span>
<span class="value">{ip}</span>
<h1 className="ip">
<span className="text">IP: </span>
<span className="value">{ip}</span>
</h1>
<p class="country">
<span class="text">Country: </span>
<span class="value">{country}</span>
<p className="country">
<span className="text">Country: </span>
<span className="value">{country}</span>
</p>
<p class="region">
<span class="text">Region: </span>
<span class="value">{regionName}</span>
<p className="region">
<span className="text">Region: </span>
<span className="value">{regionName}</span>
</p>
<p class="city">
<span class="text">City: </span>
<span class="value">{city}</span>
<p className="city">
<span className="text">City: </span>
<span className="value">{city}</span>
</p>
<p class="isp">
<span class="text">ISP: </span>
<span class="value">{isp}</span>
<p className="isp">
<span className="text">ISP: </span>
<span className="value">{isp}</span>
</p>
</div>
);
Expand Down
183 changes: 94 additions & 89 deletions src/screens/CallScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function CallScreen({ clientId }) {
pc.onicecandidate = onIceCandidate;
pc.ontrack = onTrack;
pc.onsignalingstatechange = (ev) => {
console.log("SignalStateChanged", pc.signalingState, ev);
console.log("SignalStateChanged", pc.signalingState);
setSignalState(pc.signalingState);
};

Expand Down Expand Up @@ -201,60 +201,64 @@ function CallScreen({ clientId }) {
type: "outbound-rtp"
} */

const remoteInboundRtp = outboundRtp.getRemoteInboundRtp();

const remoteInboundRtpStats = remoteInboundRtp.stats

const { roundTripTime, kind } = remoteInboundRtp.stats;
if (doLog) {
console.log("remoteInboundRtp (" + kind + ")", remoteInboundRtp.stats)
}

monitor.addExtensionStats({
type: "REMOTE_IN_BOUND_RTC",
payload: JSON.stringify({
"stats": remoteInboundRtpStats
}),
})

if (kind === "video") {
setVideoRTT(roundTripTime)
/* stats contains: {
codecId: "57e44166",
fractionLost: 0,
id: "49881f3",
jitter: 0.004,
kind: "video",
localId: "93489802",
mediaType: "video",
packetsLost: 0,
packetsReceived: 97,
roundTripTime: 0.026,
roundTripTimeMeasurements: 40,
ssrc: 3647127630,
timestamp: undefined,
totalRoundTripTime: 0.776,
type: "remote-inbound-rtp"
} */
} else if (kind === "audio") {
setAudioRTT(roundTripTime)
/* stats contains: {
codecId: "ce84b808",
fractionLost: 0,
id: "1c3c052d",
jitter: 0.004,
kind: "audio",
localId: "e9eea0d0",
mediaType: "audio",
packetsLost: 0,
packetsReceived: 1191,
roundTripTime: 0.021,
roundTripTimeMeasurements: 20,
ssrc: 342435103,
timestamp: undefined,
totalRoundTripTime: 0.376,
type: "remote-inbound-rtp"
} */
if (outboundRtp.getRemoteInboundRtp()) {
const remoteInboundRtp = outboundRtp.getRemoteInboundRtp();



const remoteInboundRtpStats = remoteInboundRtp.stats

const { roundTripTime, kind } = remoteInboundRtp.stats;
if (doLog) {
console.log("remoteInboundRtp (" + kind + ")", remoteInboundRtp.stats)
}

monitor.addExtensionStats({
type: "REMOTE_IN_BOUND_RTC",
payload: JSON.stringify({
"stats": remoteInboundRtpStats
}),
})

if (kind === "video") {
setVideoRTT(roundTripTime)
/* stats contains: {
codecId: "57e44166",
fractionLost: 0,
id: "49881f3",
jitter: 0.004,
kind: "video",
localId: "93489802",
mediaType: "video",
packetsLost: 0,
packetsReceived: 97,
roundTripTime: 0.026,
roundTripTimeMeasurements: 40,
ssrc: 3647127630,
timestamp: undefined,
totalRoundTripTime: 0.776,
type: "remote-inbound-rtp"
} */
} else if (kind === "audio") {
setAudioRTT(roundTripTime)
/* stats contains: {
codecId: "ce84b808",
fractionLost: 0,
id: "1c3c052d",
jitter: 0.004,
kind: "audio",
localId: "e9eea0d0",
mediaType: "audio",
packetsLost: 0,
packetsReceived: 1191,
roundTripTime: 0.021,
roundTripTimeMeasurements: 20,
ssrc: 342435103,
timestamp: undefined,
totalRoundTripTime: 0.376,
type: "remote-inbound-rtp"
} */
}
}
}

Expand Down Expand Up @@ -448,40 +452,41 @@ function CallScreen({ clientId }) {

<div style={{ color: "#000000" }}>
<table>

<tr>
<td>
<p>Enable console logging of RTP data connections:</p>
</td>
<td>
<input type="checkbox" onChange={handleChange} defaultChecked={logRtp} />

</td>
</tr>
<tr>
<td>
<p>Connection state:</p>
</td>
<td>
<p>{connectionState}</p>
</td>
</tr>
<tr>
<td>
<p>Ice gathering state:</p>
</td>
<td>
<p>{iceGatheringState}</p>
</td>
</tr>
<tr>
<td>
<p>Signal state:</p>
</td>
<td>
<p>{signalState}</p>
</td>
</tr>
<tbody>
<tr>
<td>
<p>Enable console logging of RTP data connections:</p>
</td>
<td>
<input type="checkbox" onChange={handleChange} defaultChecked={logRtp} />

</td>
</tr>
<tr>
<td>
<p>Connection state:</p>
</td>
<td>
<p>{connectionState}</p>
</td>
</tr>
<tr>
<td>
<p>Ice gathering state:</p>
</td>
<td>
<p>{iceGatheringState}</p>
</td>
</tr>
<tr>
<td>
<p>Signal state:</p>
</td>
<td>
<p>{signalState}</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/screens/HomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ function HomeScreen({ room, setRoom, username, setUsername, clientId }) {
return (
<form method="post" action="">
<Location></Location>
<label for="username">Username</label>
<label htmlFor="username">Username</label>

<input class="username-input"
<input className="username-input"
value={username}
title="username"
onInput={(e) => setUsername(e.target.value)}
/>

<label for="room">Room</label>
<label htmlFor="room">Room</label>

<input class="room-input"
<input className="room-input"
value={room}
title="room"
onInput={(e) => setRoom(e.target.value)}
Expand Down

0 comments on commit b23d8a4

Please sign in to comment.