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() {
1919 appendLocalCandidateStats,
2020 appendRemoteCandidateStats,
2121 appendDiskDataChannelStats,
22+ setCodecInfo,
23+ codecInfo,
2224 } = useRTCStore ( ) ;
2325
2426 useInterval ( function collectWebRTCStats ( ) {
@@ -52,6 +54,8 @@ export default function ConnectionStatsSidebar() {
5254 }
5355 } else if ( report . type === "data-channel" && report . label === "disk" ) {
5456 appendDiskDataChannelStats ( report ) ;
57+ } else if ( report . type === "codec" ) {
58+ setCodecInfo ( report ) ;
5559 }
5660 } ) ;
5761 } ) ( ) ;
@@ -124,7 +128,18 @@ export default function ConnectionStatsSidebar() {
124128 < div className = "space-y-3" >
125129 < SettingsSectionHeader
126130 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+ }
128143 />
129144
130145 { /* RTP Jitter */ }
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ export interface RTCState {
131131 appendInboundRtpStats : ( stats : RTCInboundRtpStreamStats ) => void ;
132132 clearInboundRtpStats : ( ) => void ;
133133
134+ codecInfo : RTCRtpCodec | null ;
135+ setCodecInfo : ( info : RTCRtpCodec ) => void ;
136+
134137 candidatePairStats : Map < number , RTCIceCandidatePairStats > ;
135138 appendCandidatePairStats : ( stats : RTCIceCandidatePairStats ) => void ;
136139 clearCandidatePairStats : ( ) => void ;
@@ -179,6 +182,9 @@ export const useRTCStore = create<RTCState>(set => ({
179182 isTurnServerInUse : false ,
180183 setTurnServerInUse : ( inUse : boolean ) => set ( { isTurnServerInUse : inUse } ) ,
181184
185+ codecInfo : null ,
186+ setCodecInfo : ( info : RTCRtpCodec ) => set ( { codecInfo : info } ) ,
187+
182188 inboundRtpStats : new Map ( ) ,
183189 appendInboundRtpStats : ( stats : RTCInboundRtpStreamStats ) => {
184190 set ( prevState => ( {
You can’t perform that action at this time.
0 commit comments