我正在使用Twilio进行视频通话并且工作正常,但唯一的问题是无法设置远程视频的全屏。在Twilio视频文档中搜索后,它显示垂直已满而不是水平,我发现下面的片段显然无法正常工作。
let videoConstraints = TVIVideoConstraints { (constraints) in
constraints.maxSize = TVIVideoConstraintsSize960x540;
constraints.minSize = TVIVideoConstraintsSize960x540;
constraints.maxFrameRate = TVIVideoConstraintsFrameRateNone;
constraints.minFrameRate = TVIVideoConstraintsFrameRateNone;
camera = TVICameraCapturer(source: .frontCamera, delegate: self)
localVideoTrack = TVILocalVideoTrack.init(capturer: camera!,
enabled: true,
constraints: videoConstraints)
它抛出以下异常,请帮助我
"Error: Failed to create a video track using the local camera."
视频通话适用于iPhone SE,6,6s,7种外形尺寸
答案 0 :(得分:0)
Twilio开发者传道者在这里。
我刚注意到虽然the documentation确实告诉您通过TVILocalVideoTrack.init
实施约束,但特定的iOS文档会说not to use the init
方法。
您是否尝试过trackWithCapturer:enabled:constraints
?
TVILocalVideoTrack.trackWithCapturer(camera!, enabled: true, constraints: videoConstraints)