Skip to content

Commit

Permalink
Inject platform and locale to Duck Player CSS feature
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed Aug 26, 2024
1 parent 97e5f9c commit a3c0319
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@ class DuckPlayerJSHelper @Inject constructor(
)
duckPlayer.duckPlayerOverlayHidden()

if (featureName == DUCK_PLAYER_PAGE_FEATURE_NAME) {
jsonObject.put("platform", JSONObject("""{ name: "android" }"""))
jsonObject.put("locale", java.util.Locale.getDefault().language)
jsonObject.put("env", if (appBuildConfig.isDebug) "development" else "production")
when (featureName) {
DUCK_PLAYER_PAGE_FEATURE_NAME -> {
jsonObject.put("platform", JSONObject("""{ name: "android" }"""))
jsonObject.put("locale", java.util.Locale.getDefault().language)
jsonObject.put("env", if (appBuildConfig.isDebug) "development" else "production")
}
DUCK_PLAYER_FEATURE_NAME -> {
jsonObject.put("platform", JSONObject("""{ name: "android" }"""))
jsonObject.put("locale", java.util.Locale.getDefault().language)
}
}

return JsCallbackData(
Expand Down

0 comments on commit a3c0319

Please sign in to comment.