[英]Can't get Twilio's conversation video preview to show up
我正在嘗試使用示例代碼來獲取相機的預覽。 但是,沒有任何反應。 我嘗試了許多其他操作,包括在TWCCameraCapturer
屬性上手動調用startPreview()
。 有趣的是,當我與空白收件人發起對話時,預覽的確會顯示出來。
該示例缺少顯示預覽所需的其他幾行代碼。 嘗試這個:
self.camera!.videoTrack?.attach(self.localMediaView)
self.camera!.videoTrack?.delegate = self;
// Start the preview.
self.camera!.startPreview();
self.localMediaView!.addSubview((self.camera!.previewView)!)
self.camera!.previewView?.frame = self.localMediaView!.bounds
self.camera!.previewView?.contentMode = .ScaleAspectFit
self.camera!.previewView?.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.