【问题标题】:swift - Twilio Video Chat - Alert when freezesswift - Twilio 视频聊天 - 冻结时发出警报
【发布时间】:2018-03-06 15:45:24
【问题描述】:

我正在使用 Twilio iOS SDK 实现视频聊天功能 通话效果很好,但如果对方当前不在视频聊天中,我想为收件人显示(而不是显示您不再广播时出现的常规冻结静态图像)。

我正在尝试在应用程序进入后台后立即发送停止流式传输的命令,但这似乎没有通过,用户仍然获得另一个的静态图像,因此我们无法为此显示一些标签。

有任何想法或有类似问题的人吗?

亲切的问候,

马丁

【问题讨论】:

  • 您是否为您的TVIRoomDelegate 实施了room:participantDidDisconnect

标签: ios swift twilio twilio-api twilio-click-to-call


【解决方案1】:

从他们的支持中得到解决问题的答案:

我们的 TVICameraCapturer 不会自动启用/禁用 TVILocalVideoTrack 以响应中断。但是,使用 TVICameraCapturerDelegate 很容易自己实现。

extension ViewController : TVICameraCapturerDelegate {
    func cameraCapturer(_ capturer: TVICameraCapturer, didStartWith source: TVICameraCaptureSource) {
        // Layout the camera preview with dimensions appropriate for our orientation.
        self.view.setNeedsLayout()

        if (!localVideoTrack.isEnabled) {
            localVideoTrack.isEnabled = true;
        }
    }

    func cameraCapturerWasInterrupted(_ capturer: TVICameraCapturer, reason: AVCaptureSessionInterruptionReason) {
        localVideoTrack.isEnabled = false
    }
}

希望这对某人有所帮助!

【讨论】:

    猜你喜欢
    • 2019-09-22
    • 1970-01-01
    • 2020-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多