openvidu-angular: Avoid possible errors applying custom frame rate

pull/828/head
Carlos Santos 2023-10-23 12:09:17 +02:00
parent 98b783e968
commit 96af7d3225
1 changed files with 15 additions and 1 deletions

View File

@ -245,8 +245,22 @@ export class OpenViduService {
this.disconnectSession(this.screenSession);
}
/**
*
* Apply the new resolution to the video stream if it is CAMERA type.
* @param streamManager
* @internal
*/
async updateVideoEncodingParameters(streamManager: StreamManager) {
if (!streamManager) return;
if (
!streamManager ||
!streamManager.stream ||
!streamManager.stream.getMediaStream() ||
streamManager.stream.typeOfVideo === VideoType.SCREEN
) {
return;
}
const track = streamManager?.stream.getMediaStream().getVideoTracks()[0];
const videoSender = streamManager?.stream
.getRTCPeerConnection()