package com.duben.microtribe.video.csj

import android.content.Context
import android.util.Log
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.DPSdkConfig

/**
 *  穿山甲短剧SDK
 */
object DPHolderManager {

    const val TAG = "DPHolderManager"

    var isDPStarted = false

    fun initDpSdk(context: Context) {

        //1. 初始化，最好放到application.onCreate()执行
        val configBuilder = DPSdkConfig.Builder().debug(true)
        DPSdk.init(context, "SDK_Setting_5538933.json", configBuilder.build())

        startDpSdk()
    }

    fun startDpSdk() {
        DPSdk.start { isSuccess, message ->
            //请确保使用Sdk时Sdk已经成功启动
            //isSuccess=true表示启动成功
            //启动失败，可以再次调用启动接口（建议最多不要超过3次)
            isDPStarted = isSuccess
            Log.e(TAG, "start result=$isSuccess, msg=$message")
        }
    }


}