Opentok:OTCameraCaptureResolution在快速

时间:2017-07-29 06:10:53

标签: objective-c swift webrtc opentk tokbox

我需要更改发布商的视频质量。 我面临从 Objective C到Swift 3.0 的转换问题。

这是我的目标C代码:

   OTPublisherSettings *settings = [[OTPublisherSettings alloc] init];
settings.name = @"Bob's video";
settings.audioTrack = NO;
settings.videoTrack = YES;
settings.cameraResolution = OTCameraCaptureResolutionHigh;
settings.cameraFrameRate = OTCameraCaptureFrameRate30FPS;

,转换的Swift代码

let settings = OTPublisherSettings()
 settings.name = "Bob's video"
settings.audioTrack = false
settings.videoTrack = true
settings.cameraResolution = OTCameraCaptureResolutionHigh
settings.cameraFrameRate = OTCameraCaptureFrameRate30FPS

最后两行显示错误消息“使用未解析的标识符'OTCameraCaptureResolutionHigh'”。 请指教。似乎swift在上面使用了另一组变量。

1 个答案:

答案 0 :(得分:3)

let settings = OTPublisherSettings()
settings.name = "Bob's video"
settings.audioTrack = false
settings.videoTrack = true
settings.cameraResolution = .high
settings.cameraFrameRate = .30fps