File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export default function ConnectionStatsSidebar() {
19
19
appendLocalCandidateStats,
20
20
appendRemoteCandidateStats,
21
21
appendDiskDataChannelStats,
22
+ setCodecInfo,
23
+ codecInfo,
22
24
} = useRTCStore ( ) ;
23
25
24
26
useInterval ( function collectWebRTCStats ( ) {
@@ -52,6 +54,8 @@ export default function ConnectionStatsSidebar() {
52
54
}
53
55
} else if ( report . type === "data-channel" && report . label === "disk" ) {
54
56
appendDiskDataChannelStats ( report ) ;
57
+ } else if ( report . type === "codec" ) {
58
+ setCodecInfo ( report ) ;
55
59
}
56
60
} ) ;
57
61
} ) ( ) ;
@@ -124,7 +128,18 @@ export default function ConnectionStatsSidebar() {
124
128
< div className = "space-y-3" >
125
129
< SettingsSectionHeader
126
130
title = "Video"
127
- description = "The video stream from the JetKVM to the client."
131
+ description = { < >
132
+ The video stream from the JetKVM to the client.
133
+ { codecInfo && < div className = "text-xs text-slate-700 dark:text-slate-300 mt-1 flex flex-col" >
134
+ < div >
135
+ Current codec: < strong > { codecInfo . mimeType } </ strong >
136
+ </ div >
137
+ < div >
138
+ Clock Rate: < strong > { codecInfo . clockRate } </ strong >
139
+ </ div >
140
+ </ div > }
141
+ </ >
142
+ }
128
143
/>
129
144
130
145
{ /* RTP Jitter */ }
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ export interface RTCState {
131
131
appendInboundRtpStats : ( stats : RTCInboundRtpStreamStats ) => void ;
132
132
clearInboundRtpStats : ( ) => void ;
133
133
134
+ codecInfo : RTCRtpCodec | null ;
135
+ setCodecInfo : ( info : RTCRtpCodec ) => void ;
136
+
134
137
candidatePairStats : Map < number , RTCIceCandidatePairStats > ;
135
138
appendCandidatePairStats : ( stats : RTCIceCandidatePairStats ) => void ;
136
139
clearCandidatePairStats : ( ) => void ;
@@ -179,6 +182,9 @@ export const useRTCStore = create<RTCState>(set => ({
179
182
isTurnServerInUse : false ,
180
183
setTurnServerInUse : ( inUse : boolean ) => set ( { isTurnServerInUse : inUse } ) ,
181
184
185
+ codecInfo : null ,
186
+ setCodecInfo : ( info : RTCRtpCodec ) => set ( { codecInfo : info } ) ,
187
+
182
188
inboundRtpStats : new Map ( ) ,
183
189
appendInboundRtpStats : ( stats : RTCInboundRtpStreamStats ) => {
184
190
set ( prevState => ( {
You can’t perform that action at this time.
0 commit comments