Skip to content

Commit

Permalink
Fix UI config
Browse files Browse the repository at this point in the history
  • Loading branch information
tvanlaerhoven committed Dec 20, 2023
1 parent e9b6ed7 commit 4ccff6e
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import com.theoplayer.android.api.ads.AdsConfiguration
import com.theoplayer.android.api.ads.AdPreloadType
import com.theoplayer.android.api.cast.CastStrategy
import com.theoplayer.android.api.cast.CastConfiguration
import com.theoplayer.android.api.cast.UIConfiguration
import com.theoplayer.android.api.pip.PipConfiguration
import com.theoplayer.android.api.player.NetworkConfiguration
import com.theoplayer.android.api.ui.UIConfiguration

private const val PROP_LICENSE = "license"
private const val PROP_LICENSE_URL = "licenseUrl"
Expand Down Expand Up @@ -103,21 +103,19 @@ class PlayerConfigAdapter(private val configProps: ReadableMap?) {
}

/**
* Get UIConfiguration object; these properties apply:
* - language: The language used to localize the ui elements.
*/
fun uiConfig(): UIConfiguration {
return UIConfiguration.Builder().apply {
configProps?.getMap(PROP_UI_CONFIGURATION)?.run {
if (hasKey(PROP_LANGUAGE)) {
val languageString = getString(PROP_LANGUAGE)
if (!TextUtils.isEmpty(languageString)) {
language(languageString)
}
}
* Get UIConfiguration object; these properties apply:
* - language: The language used to localize the ui elements.
*/
private fun uiConfig(): UIConfiguration {
return UIConfiguration.Builder().apply {
configProps?.getMap(PROP_UI_CONFIGURATION)?.run {
val languageString = getString(PROP_LANGUAGE)
if (languageString != null && !TextUtils.isEmpty(languageString)) {
language(languageString)
}
}.build()
}
}
}.build()
}

/**
* Create a AdsRenderingSettings object.
Expand Down

0 comments on commit 4ccff6e

Please sign in to comment.