mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: fix video codec retrieval
parent
3ad506e01a
commit
7820e02574
|
@ -826,28 +826,27 @@ export class VideoComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
async showCodecUsed() {
|
async showCodecUsed() {
|
||||||
let stats = await this.streamManager.stream.getWebRtcPeer().pc.getStats();
|
let stats = await this.streamManager.stream.getWebRtcPeer().pc.getStats();
|
||||||
let codecIdIndex = null;
|
let codecIdIndex: string = null;
|
||||||
// Search codec Index
|
// Search codec Index
|
||||||
stats.forEach(report => {
|
stats.forEach(report => {
|
||||||
console.log(report);
|
console.log(report);
|
||||||
if (!this.streamManager.remote && report.id.includes("RTCOutboundRTPVideoStream")) {
|
if (!this.streamManager.remote && report.type === 'outbound-rtp' && report.mediaType === 'video') {
|
||||||
codecIdIndex = report.codecId;
|
codecIdIndex = report.codecId;
|
||||||
|
} else if (this.streamManager.remote && report.type === 'inbound-rtp' && report.mediaType === 'video') {
|
||||||
} else if (this.streamManager.remote && report.id.includes("RTCInboundRTPVideoStream")) {
|
|
||||||
codecIdIndex = report.codecId;
|
codecIdIndex = report.codecId;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
// Search codec Info
|
// Search codec Info
|
||||||
stats.forEach(report => {
|
stats.forEach(report => {
|
||||||
if (report.id === codecIdIndex) {
|
if (report.id === codecIdIndex) {
|
||||||
this.usedVideoCodec = report.mimeType;
|
this.usedVideoCodec = report.mimeType;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.dialog.open(ShowCodecDialogComponent, {
|
this.dialog.open(ShowCodecDialogComponent, {
|
||||||
data: {
|
data: {
|
||||||
usedVideoCodec: this.usedVideoCodec
|
usedVideoCodec: this.usedVideoCodec
|
||||||
},
|
},
|
||||||
width: '450px'
|
width: '295px'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue