Class PlayerListeners


  • public class PlayerListeners
    extends Object
    This class helps to manage a set of PlayerListeners and delegates to the listener methods. It can manages the list of listeners and ensure that concurrent modification are prevented and listeners can be added and removed in a thread safe manner.

    If you are using the fireError(CastlabsPlayerException) methods to delegate errors to the listeners, please note that the delegation will be done one the same thread.

    Since:
    3.0.0
    • Method Detail

      • fireLicenseKeysLoaded

        public void fireLicenseKeysLoaded()
        INTERNAL: Fire an license keys loaded event to all registered listeners.
      • fireLicenseKeysChanged

        public void fireLicenseKeysChanged()
        INTERNAL: Fire an license keys changed event to all registered listeners.
      • fireLicenseLoadError

        public void fireLicenseLoadError​(int currentAttempt,
                                         int maxAttempts,
                                         @Nullable
                                         DownloadException downloadException)
      • reportConnectivityLost

        public void reportConnectivityLost()
        Call this method to report loss of connectivity. This will delegate a new error to any registered listeners and cache the connectivity state.
      • reportConnectivityGained

        public void reportConnectivityGained()
        Call this method to report loss of connectivity. This will delegate a new error to any registered listeners and cache the connectivity state.
      • reset

        public void reset()