tencent cloud

Multiple Network Acceleration

    문서Multiple Network Acceleration

    TRTC Plug-In Integration

    다운로드
    포커스 모드
    폰트 크기
    마지막 업데이트 시간: 2026-05-21 16:16:48

    Configuring Dependencies

    First, introduce TRTCSDK. See TRTC documentation (SOCKS5 acceleration is only supported in TRTC 11.6 and later).
    Then, configure acceleration and the TRTC plug-in SDK: MpAccSDK and TRTCAccPlugin. Among them, Network.framework is the system database.
    
    
    

    Example Code

    class TRTCPluginDemoViewController: UIViewController {
    private let accClient: MpAccClient = MpAccClient.shared
    override func viewDidLoad() {
    super.viewDidLoad()
    AccPluginManager.shared.setAccProxyPlugin(TRTCAccPlugin())
    accClient.setupDatakey("xxxx", deviceId: "xxxx")
    }
    deinit {
    AccPluginManager.shared.setAccProxyPlugin(nil)
    accClient.stop()
    }
    // Enable TRTC
    func startTRTCSDK() { /*enable VPN*/ }
    }
    extension TRTCPluginDemoViewController: TRTCCloudDelegate {
    func onEnterRoom(_ result: Int) {
    guard result > 0 else { return }
    accClient.registerAccCallback(self)
    let config = AccConfig()
    config.accMode = .FastSwitching //1: Aggregation acceleration 2: Dual transmission acceleration 3: Fast switching acceleration
    config.pingInterval = 3
    accClient.start(config: config)
    }
    func onExitRoom(_ reason: Int) {
    accClient.stop()
    accClient.unRegisterAccCallback(self)
    }
    }
    
    extension TRTCPluginDemoViewController: AccCallback {
    configure callback
    }
    

    도움말 및 지원

    문제 해결에 도움이 되었나요?

    피드백