package com.rong.io.live.helper;

import com.cooleshow.base.utils.Utils;
import com.rong.io.live.config.LiveConfig;

import cn.rongcloud.rtc.api.RCRTCConfig;
import cn.rongcloud.rtc.api.RCRTCEngine;

/**
 * Author by pq, Date on 2022/4/12.
 */
public class LiveRTCEngineInitHelper {

    public static void initRTC() {
        RCRTCConfig.Builder rtcConfig = RCRTCConfig.Builder.create();
        RCRTCEngine.getInstance().enableSpeaker(true);
        RCRTCEngine.getInstance().init(Utils.getApp().getApplicationContext(), rtcConfig.build());
        LiveConfig.isNeedReInitRTC = false;
    }

    /**
     * 设置生效美颜功能
     */
    public static void openBeauty(){
        RCRTCEngine.getInstance().init(Utils.getApp().getApplicationContext(), RCRTCConfig.Builder.create().enableEncoderTexture(true).build());
    }

    public static void setRTCSpeakerMode(boolean enable){
        RCRTCEngine.getInstance().enableSpeaker(enable);
    }
}
