From 4ccff6e8eb5eb8bd54c2666edb3333b0a294ccf7 Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Wed, 20 Dec 2023 13:06:41 +0100 Subject: [PATCH] Fix UI config --- .../com/theoplayer/PlayerConfigAdapter.kt | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt b/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt index 6f601f5d4..b64843599 100644 --- a/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt +++ b/android/src/main/java/com/theoplayer/PlayerConfigAdapter.kt @@ -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" @@ -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.