feat(android): support hiding Exoplayer video duration on android (#4090)
* feat: support for hiding duration on Android * docs: add hideDuration property to control styles documentation
This commit is contained in:
@@ -6,6 +6,7 @@ import com.facebook.react.bridge.ReadableMap
|
||||
class ControlsConfig {
|
||||
var hideSeekBar: Boolean = false
|
||||
var seekIncrementMS: Int = 10000
|
||||
var hideDuration: Boolean = false
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@@ -15,6 +16,7 @@ class ControlsConfig {
|
||||
if (src != null) {
|
||||
config.hideSeekBar = ReactBridgeUtils.safeGetBool(src, "hideSeekBar", false)
|
||||
config.seekIncrementMS = ReactBridgeUtils.safeGetInt(src, "seekIncrementMS", 10000)
|
||||
config.hideDuration = ReactBridgeUtils.safeGetBool(src, "hideDuration", false)
|
||||
}
|
||||
|
||||
return config
|
||||
|
@@ -554,7 +554,13 @@ public class ReactExoplayerView extends FrameLayout implements
|
||||
exoPosition.setLayoutParams(param);
|
||||
}else{
|
||||
exoProgress.setVisibility(VISIBLE);
|
||||
exoDuration.setVisibility(VISIBLE);
|
||||
|
||||
if(controlsConfig.getHideDuration()){
|
||||
exoDuration.setVisibility(GONE);
|
||||
}else{
|
||||
exoDuration.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
// Reset the layout parameters of exoPosition to their default state
|
||||
LinearLayout.LayoutParams defaultParam = new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
|
Reference in New Issue
Block a user