Polyv Help Center

Help Center

连麦RTC模块剪裁

Updated: 2026-01-07 17:45:06

1 What is RTC Dependency Trimming for Co-hosting

RTC dependency trimming for co-hosting is a shell technical solution supported by the multi-scenario SDK. It allows you to selectively choose the desired RTC dependencies in the dependency configuration or remove them entirely. After removal, the corresponding co-hosting and RTC functions become unavailable, but it does not affect code compilation or the operation of other features.

To further reduce the app package size, the multi-scenario SDK supports on-demand trimming or even complete removal of the co-hosting RTC module dependencies.

Generally, for co-hosting, only one RTC reference dependency needs to be retained. Excluding the other two RTC reference dependencies can significantly reduce the package size.

2 Why RTC Dependency Trimming for Co-hosting is Needed

  1. Further reduce the package size;
  2. Speed up compilation time;

3 Usage

3.1 Version Requirements

Supported across all versions of the multi-scenario SDK.

3.2 Dependency Configuration

api ('net.polyv.android:polyvSDKLiveScenes:x.y.z'){
    exclude group: 'net.polyv.android',module:'plvARTC'
    exclude group: 'net.polyv.android',module:'plvURTC'
    exclude group: 'net.polyv.android',module:'plvTRTC'
}
// 1.17.0以上不需要再依赖这3个空包
implementation 'net.polyv.android:plvARTCEmpty:x.y.z'
implementation 'net.polyv.android:plvURTCEmpty:x.y.z'
implementation 'net.polyv.android:plvTRTCEmpty:x.y.z'

Packages with the empty suffix are shell packages. By excluding the original RTC package and depending on the shell package, trimming is completed.

Note: Please select the version of RTC used in the current project. (You can check it via External Libraries in the bottom left corner of AndroidStudio.)

4 FAQ

4.1 Do I need to modify the Demo layer code (open-source code part)?

No.

Yes, but it is not recommended.

If you do not want to use the co-hosting feature, simply avoid initiating co-hosting from the broadcasting end, and the viewing end will naturally not respond.

联系客服,在线咨询
在线咨询