我正在尝试在webRTC中更改本地视频分辨率。我使用以下方法创建本地视频跟踪器:
-(RTCVideoTrack *)createLocalVideoTrack {
RTCVideoTrack *localVideoTrack = nil;
RTCMediaConstraints *mediaConstraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil optionalConstraints:nil];
RTCAVFoundationVideoSource *source =
[self.factory avFoundationVideoSourceWithConstraints:mediaConstraints];
localVideoTrack =
[self.factory videoTrackWithSource:source
trackId:@"ARDAMSv0"];
return localVideoTrack;
}
Run Code Online (Sandbox Code Playgroud)
我将强制性约束设置如下,但是它不起作用:
@{@"minFrameRate":@"20",@"maxFrameRate":@"30",@"maxWidth":@"320",@"minWidth":@"240",@"maxHeight":@"320",@"minHeight":@"240"};
Run Code Online (Sandbox Code Playgroud)
有人可以帮我吗?