Vinod
Vinod

Reputation: 675

Opentok: OTCameraCaptureResolutionHigh equivalent variable in swift

I need to change the video quality of my publisher. I face a conversion problem from Objective C to Swift 3.0.

Here is my Objective C code:

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

and the converted Swift code is

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

Last two lines show error messages "Use of unresolved identifier 'OTCameraCaptureResolutionHigh'". Please advise. It seems swift uses another set of variables for the above.

Upvotes: 2

Views: 117

Answers (1)

Irshad Ahmad
Irshad Ahmad

Reputation: 1383

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

Upvotes: 3

Related Questions