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
  • 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
    • getLogAudioRendererEvents

      public boolean getLogAudioRendererEvents()
      Getter for logAudioRendererEvents
      Returns:
      logAudioRendererEvents
    • setLogAudioRendererEvents

      public void setLogAudioRendererEvents(boolean logAudioRendererEvents)
      Setter for logAudioRendererEvents
      Parameters:
      logAudioRendererEvents - 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
    • getLogTimingDebugInfo

      public boolean getLogTimingDebugInfo()
      Returns:
      whether timing info logging is enabled
    • setLogTimingDebugInfo

      public void setLogTimingDebugInfo(boolean logTimingDebugInfo)
      Log timing info related to playback. This is particularly helpful for live streams
      Parameters:
      logTimingDebugInfo - set whether to log timing info
    • 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