Class PlayerSettingsFragment

java.lang.Object
androidx.fragment.app.Fragment
com.castlabs.sdk.debug.view.PlayerSettingsFragment
All Implemented Interfaces:
ComponentCallbacks, View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

public class PlayerSettingsFragment extends androidx.fragment.app.Fragment
A fragment that provides a user interface for configuring player settings. This includes playback configuration, ABR (Adaptive Bitrate) settings, buffer configuration, and bandwidth estimation parameters.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Interface for views that can be reset to their default values.

    Nested classes/interfaces inherited from class androidx.fragment.app.Fragment

    androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Maximum allowed rate limit in bits per second
    static final long
    Minimum allowed rate limit in bits per second
    static final String
    Key for back buffer duration setting
    static final String
    Key for clip end setting
    static final String
    Key for clip start setting
    static final String
    Key for degradation penalty setting
    static final String
    Key for degradation recovery setting
    static final String
    Key for degradation samples setting
    static final String
    Key for drain while charging setting
    static final String
    Key for ABR algorithm setting
    static final String
    Key for bandwidth fraction setting
    static final String
    Key for buffer size in bytes setting
    static final String
    Key for maximum buffer size time setting
    static final String
    Key for minimum buffer size time setting
    static final String
    Key for download time factor setting
    static final String
    Key for initial bandwidth setting
    static final String
    Key for maximum decrease setting
    static final String
    Key for minimum increase setting
    static final String
    Key for rate limit setting
    static final String
    Key for retain buffer setting
    static final String
    Key for safe buffer setting
    static final String
    Key for minimum restart buffer setting
    static final String
    Key for minimum start buffer setting
    static final String
    Key for percentile weight setting
    static final String
    Name of the SharedPreferences store for ABR settings
    static final String
    Key for time over memory setting

    Fields inherited from class androidx.fragment.app.Fragment

    mPreviousWho
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for PlayerSettingsFragment.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onAttach(Context context)
     
    onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
     
    void
    Reset the config views and load their value from the current preferences or defaults

    Methods inherited from class androidx.fragment.app.Fragment

    dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • PREFS_STORE_NAME

      public static final String PREFS_STORE_NAME
      Name of the SharedPreferences store for ABR settings
      See Also:
    • PREFS_KEY_RATELIMIT

      public static final String PREFS_KEY_RATELIMIT
      Key for rate limit setting
      See Also:
    • PREFS_KEY_INITIAL_BANDWIDTH

      public static final String PREFS_KEY_INITIAL_BANDWIDTH
      Key for initial bandwidth setting
      See Also:
    • PREFS_KEY_MIN_INCREASE

      public static final String PREFS_KEY_MIN_INCREASE
      Key for minimum increase setting
      See Also:
    • PREFS_KEY_MAX_DECREASE

      public static final String PREFS_KEY_MAX_DECREASE
      Key for maximum decrease setting
      See Also:
    • PREFS_KEY_BANDWIDTH_FRACTION

      public static final String PREFS_KEY_BANDWIDTH_FRACTION
      Key for bandwidth fraction setting
      See Also:
    • PREFS_KEY_DOWNLOAD_TIME_FACTOR

      public static final String PREFS_KEY_DOWNLOAD_TIME_FACTOR
      Key for download time factor setting
      See Also:
    • PREFS_KEY_RETAIN

      public static final String PREFS_KEY_RETAIN
      Key for retain buffer setting
      See Also:
    • PREFS_KEY_SAFE_BUFFER

      public static final String PREFS_KEY_SAFE_BUFFER
      Key for safe buffer setting
      See Also:
    • PREFS_KEY_ALGO

      public static final String PREFS_KEY_ALGO
      Key for ABR algorithm setting
      See Also:
    • PREFS_KEY_BUFFER_SIZE_BYTES

      public static final String PREFS_KEY_BUFFER_SIZE_BYTES
      Key for buffer size in bytes setting
      See Also:
    • PREFS_KEY_BUFFER_SIZE_MIN_TIME

      public static final String PREFS_KEY_BUFFER_SIZE_MIN_TIME
      Key for minimum buffer size time setting
      See Also:
    • PREFS_KEY_BUFFER_SIZE_MAX_TIME

      public static final String PREFS_KEY_BUFFER_SIZE_MAX_TIME
      Key for maximum buffer size time setting
      See Also:
    • PREFS_DRAIN_WHILE_CHARGING

      public static final String PREFS_DRAIN_WHILE_CHARGING
      Key for drain while charging setting
      See Also:
    • PREFS_TIME_OVER_MEMORY

      public static final String PREFS_TIME_OVER_MEMORY
      Key for time over memory setting
      See Also:
    • PREFS_MIN_START_BUFFER

      public static final String PREFS_MIN_START_BUFFER
      Key for minimum start buffer setting
      See Also:
    • PREFS_MIN_RESTART_BUFFER

      public static final String PREFS_MIN_RESTART_BUFFER
      Key for minimum restart buffer setting
      See Also:
    • PREFS_BACK_BUFFER_DURATION

      public static final String PREFS_BACK_BUFFER_DURATION
      Key for back buffer duration setting
      See Also:
    • PREFS_CLIP_START

      public static final String PREFS_CLIP_START
      Key for clip start setting
      See Also:
    • PREFS_CLIP_END

      public static final String PREFS_CLIP_END
      Key for clip end setting
      See Also:
    • PREFS_PERCENTILE_WEIGHT

      public static final String PREFS_PERCENTILE_WEIGHT
      Key for percentile weight setting
      See Also:
    • PREFS_DEGRADATION_PENALTY

      public static final String PREFS_DEGRADATION_PENALTY
      Key for degradation penalty setting
      See Also:
    • PREFS_DEGRADATION_RECOVERY

      public static final String PREFS_DEGRADATION_RECOVERY
      Key for degradation recovery setting
      See Also:
    • PREFS_DEGRADATION_SAMPLES

      public static final String PREFS_DEGRADATION_SAMPLES
      Key for degradation samples setting
      See Also:
    • MIN_RATE_LIMIT_BPS

      public static final long MIN_RATE_LIMIT_BPS
      Minimum allowed rate limit in bits per second
      See Also:
    • MAX_RATE_LIMIT_BPS

      public static final long MAX_RATE_LIMIT_BPS
      Maximum allowed rate limit in bits per second
      See Also:
  • Constructor Details

    • PlayerSettingsFragment

      public PlayerSettingsFragment()
      Constructor for PlayerSettingsFragment.
  • Method Details

    • onAttach

      public void onAttach(Context context)
      Overrides:
      onAttach in class androidx.fragment.app.Fragment
    • onCreateView

      @Nullable public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
      Overrides:
      onCreateView in class androidx.fragment.app.Fragment
    • reset

      public void reset()
      Reset the config views and load their value from the current preferences or defaults