Package com.castlabs.sdk.debug

# Class DebugPlugin

java.lang.Object
com.castlabs.android.Plugin
com.castlabs.sdk.debug.DebugPlugin

public class DebugPlugin extends Plugin
This plugin can be registered with `PlayerSDK.register(Plugin)` to enable additional debug logs.

Instances of the debug plugin can be created using the `DebugPlugin.Builder`. The builder is also used to configure the plugin and its logging capabilities. For example:

     PlayerSDK.register(new DebugPlugin.Builder()
         .logOpenBundle(true)
         .get()
     );

The debug plugin does also expose a rate limiter that can be enabled with `DebugPlugin.Builder.enableRateLimiter(boolean, long)` and accessed at runtime with

            DebugPlugin debugPlugin = PlayerSDK.getPlugin(DebugPlugin.class);
                    if (debugPlugin != null) {
                            RateLimiter rateLimiter = debugPlugin.getRateLimiter();
          }

The features of this plugin can be enabled or disabled after it registered to the `PlayerSDK`. For example to enable the rate limiter:

     DebugPlugin debugPlugin = PlayerSDK.getPlugin(DebugPlugin.class);
     if (debugPlugin != null) {
                    debugPlugin.setRateLimiterEnabled(true);
     }

Or the debug overlay could be shown or hidden after registration. The position of the debug overlay could also be changed. For example:

     debugPlugin.setDebugOverlayPosition(debugOverlayPosition);
     debugPlugin.hideDebugOverlay();

The debug overlay should be enabled before registration in order to show, hide or change the position of it.

Since:
  4.1.11

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DebugPlugin.Builder`
  Use this builder to create new instances of the `DebugPlugin`.
  `static enum`
  `DebugPlugin.DebugOverlayPosition`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEBUG_OVERLAY_ID`
  `final boolean`
  `enableDebugOverlay`
  `final long`
  `initialRateLimitBps`
  `final List<Integer>`
  `logRequestTypes`
  `final List<Integer>`
  `logResponseTypes`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DebugPlugin.DebugOverlayPosition`
  `getDebugOverlayPosition()`
  Getter for debugOverlayPosition
  `String`
  `getId()`
  `boolean`
  `getLogDecoderCounters()`
  Getter for logDecoderCounters
  `boolean`
  `getLogDownloadCanceled()`
  Getter for logDownloadCanceled
  `boolean`
  `getLogDownloadCompleted()`
  Getter for logDownloadCompleted
  `boolean`
  `getLogDownloadError()`
  Getter for logDownloadError
  `boolean`
  `getLogDownloadStarted()`
  Getter for logDownloadStarted
  `boolean`
  `getLogDownloadUpstreamDiscarded()`
  Getter for logDownloadUpstreamDiscarded
  `boolean`
  `getLogLoadControl()`
  Getter for logLoadControl
  `boolean`
  `getLogOpenBundle()`
  Getter for logOpenBundle
  `boolean`
  `getLogPeriodInfo()`
  Getter for logPeriodInfo
  `boolean`
  `getLogSupportedDrm()`
  Getter for logSupportedDrm
  `boolean`
  `getLogTransferInfo()`
  Getter for logTransferInfo
  `boolean`
  `getLogVideoRendererEvents()`
  Getter for logVideoRendererEvents
  `RateLimiter`
  `getRateLimiter()`
  Returns the rate limiter if it was enabled or null
  `boolean`
  `getRateLimiterEnabled()`
  Getter for rateLimiterEnabled
  `void`
  `hideDebugOverlay()`
  hides the debug overlay
  `void`
  `setDebugOverlayPosition(DebugPlugin.DebugOverlayPosition debugOverlayPosition)`
  Setter for debugOverlayPosition
  `void`
  `setLogDecoderCounters(boolean logDecoderCounters)`
  Setter for logDecoderCounters
  `void`
  `setLogDownloadCanceled(boolean logDownloadCanceled)`
  Setter for logDownloadCanceled
  `void`
  `setLogDownloadCompleted(boolean logDownloadCompleted)`
  Setter for logDownloadCompleted
  `void`
  `setLogDownloadError(boolean logDownloadError)`
  Setter for logDownloadError
  `void`
  `setLogDownloadStarted(boolean logDownloadStarted)`
  Setter for logDownloadStarted
  `void`
  `setLogDownloadUpstreamDiscarded(boolean logDownloadUpstreamDiscarded)`
  Setter for logDownloadUpstreamDiscarded
  `void`
  `setLogLoadControl(boolean logLoadControl)`
  Setter for logLoadControl
  `void`
  `setLogOpenBundle(boolean logOpenBundle)`
  Setter for logOpenBundle
  `void`
  `setLogPeriodInfo(boolean logPeriodInfo)`
  Setter for logPeriodInfo
  `void`
  `setLogSupportedDrm(boolean logSupportedDrm)`
  Setter for logSupportedDrm
  `void`
  `setLogTransferInfo(boolean logTransferInfo)`
  Setter for logTransferInfo
  `void`
  `setLogVideoRendererEvents(boolean logVideoRendererEvents)`
  Setter for logVideoRendererEvents
  `void`
  `setRateLimiterEnabled(boolean rateLimiterEnabled)`
  Setter for rateLimiterEnabled
  `void`
  `showDebugOverlay()`
  Shows the debug overlay

  ### Methods inherited from class com.castlabs.android.Plugin

  `init, onRemotePlay`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEBUG_OVERLAY_ID

    @IdRes public static final int DEBUG_OVERLAY_ID

  - ### enableDebugOverlay

    public final boolean enableDebugOverlay

  - ### initialRateLimitBps

    public final long initialRateLimitBps

  - ### logRequestTypes

    public final List<Integer> logRequestTypes

  - ### logResponseTypes

    public final List<Integer> logResponseTypes

- ## Method Details

  - ### getLogOpenBundle

    public boolean getLogOpenBundle()
    Getter for logOpenBundle
    Returns:
      logOpenBundle

  - ### setLogOpenBundle

    public void setLogOpenBundle(boolean logOpenBundle)
    Setter for logOpenBundle
    Parameters:
      `logOpenBundle` - Sets this value to the property

  - ### getLogDownloadStarted

    public boolean getLogDownloadStarted()
    Getter for logDownloadStarted
    Returns:
      logDownloadStarted

  - ### setLogDownloadStarted

    public void setLogDownloadStarted(boolean logDownloadStarted)
    Setter for logDownloadStarted
    Parameters:
      `logDownloadStarted` - Sets this value to the property

  - ### getLogDownloadCompleted

    public boolean getLogDownloadCompleted()
    Getter for logDownloadCompleted
    Returns:
      logDownloadCompleted

  - ### setLogDownloadCompleted

    public void setLogDownloadCompleted(boolean logDownloadCompleted)
    Setter for logDownloadCompleted
    Parameters:
      `logDownloadCompleted` - Sets this value to the property

  - ### getLogDownloadCanceled

    public boolean getLogDownloadCanceled()
    Getter for logDownloadCanceled
    Returns:
      logDownloadCanceled

  - ### setLogDownloadCanceled

    public void setLogDownloadCanceled(boolean logDownloadCanceled)
    Setter for logDownloadCanceled
    Parameters:
      `logDownloadCanceled` - Sets this value to the property

  - ### getLogDownloadUpstreamDiscarded

    public boolean getLogDownloadUpstreamDiscarded()
    Getter for logDownloadUpstreamDiscarded
    Returns:
      logDownloadUpstreamDiscarded

  - ### setLogDownloadUpstreamDiscarded

    public void setLogDownloadUpstreamDiscarded(boolean logDownloadUpstreamDiscarded)
    Setter for logDownloadUpstreamDiscarded
    Parameters:
      `logDownloadUpstreamDiscarded` - Sets this value to the property

  - ### getLogDownloadError

    public boolean getLogDownloadError()
    Getter for logDownloadError
    Returns:
      logDownloadError

  - ### setLogDownloadError

    public void setLogDownloadError(boolean logDownloadError)
    Setter for logDownloadError
    Parameters:
      `logDownloadError` - Sets this value to the property

  - ### getLogVideoRendererEvents

    public boolean getLogVideoRendererEvents()
    Getter for logVideoRendererEvents
    Returns:
      logVideoRendererEvents

  - ### setLogVideoRendererEvents

    public void setLogVideoRendererEvents(boolean logVideoRendererEvents)
    Setter for logVideoRendererEvents
    Parameters:
      `logVideoRendererEvents` - Sets this value to the property

  - ### getLogDecoderCounters

    public boolean getLogDecoderCounters()
    Getter for logDecoderCounters
    Returns:
      logDecoderCounters

  - ### setLogDecoderCounters

    public void setLogDecoderCounters(boolean logDecoderCounters)
    Setter for logDecoderCounters
    Parameters:
      `logDecoderCounters` - Sets this value to the property

  - ### getLogTransferInfo

    public boolean getLogTransferInfo()
    Getter for logTransferInfo
    Returns:
      logTransferInfo

  - ### setLogTransferInfo

    public void setLogTransferInfo(boolean logTransferInfo)
    Setter for logTransferInfo
    Parameters:
      `logTransferInfo` - Sets this value to the property

  - ### getLogPeriodInfo

    public boolean getLogPeriodInfo()
    Getter for logPeriodInfo
    Returns:
      logPeriodInfo

  - ### setLogPeriodInfo

    public void setLogPeriodInfo(boolean logPeriodInfo)
    Setter for logPeriodInfo
    Parameters:
      `logPeriodInfo` - Sets this value to the property

  - ### getLogSupportedDrm

    public boolean getLogSupportedDrm()
    Getter for logSupportedDrm
    Returns:
      logSupportedDrm

  - ### setLogSupportedDrm

    public void setLogSupportedDrm(boolean logSupportedDrm)
    Setter for logSupportedDrm
    Parameters:
      `logSupportedDrm` - Sets this value to the property

  - ### getLogLoadControl

    public boolean getLogLoadControl()
    Getter for logLoadControl
    Returns:
      logLoadControl

  - ### setLogLoadControl

    public void setLogLoadControl(boolean logLoadControl)
    Setter for logLoadControl
    Parameters:
      `logLoadControl` - Sets this value to the property

  - ### getRateLimiterEnabled

    public boolean getRateLimiterEnabled()
    Getter for rateLimiterEnabled
    Returns:
      rateLimiterEnabled

  - ### setRateLimiterEnabled

    public void setRateLimiterEnabled(boolean rateLimiterEnabled)
    Setter for rateLimiterEnabled
    Parameters:
      `rateLimiterEnabled` - Sets this value to the property

  - ### getDebugOverlayPosition

    public DebugPlugin.DebugOverlayPosition getDebugOverlayPosition()
    Getter for debugOverlayPosition
    Returns:
      debugOverlayPosition

  - ### setDebugOverlayPosition

    public void setDebugOverlayPosition(DebugPlugin.DebugOverlayPosition debugOverlayPosition)
    Setter for debugOverlayPosition
    Parameters:
      `debugOverlayPosition` - Sets this value to the property

  - ### showDebugOverlay

    public void showDebugOverlay()
    Shows the debug overlay

  - ### hideDebugOverlay

    public void hideDebugOverlay()
    hides the debug overlay

  - ### getId

    @NonNull public String getId()
    Specified by:
      `getId` in class `Plugin`

  - ### getRateLimiter

    @Nullable public RateLimiter getRateLimiter()
    Returns the rate limiter if it was enabled or null
    Returns:
      rate limiter or null