mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
25 lines
668 B
Kotlin
25 lines
668 B
Kotlin
package com.github.libretube.util
|
|
|
|
import android.content.Context
|
|
import com.google.net.cronet.okhttptransport.CronetCallFactory
|
|
import org.chromium.net.CronetEngine
|
|
|
|
class CronetHelper {
|
|
companion object {
|
|
private lateinit var engine: CronetEngine
|
|
lateinit var callFactory: CronetCallFactory
|
|
|
|
fun initCronet(context: Context) {
|
|
this.engine = CronetEngine.Builder(context)
|
|
.enableBrotli(true)
|
|
.build()
|
|
callFactory = CronetCallFactory.newBuilder(this.engine)
|
|
.build()
|
|
}
|
|
|
|
fun getCronetEngine(): CronetEngine {
|
|
return engine
|
|
}
|
|
}
|
|
}
|