Class BlocklistException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.castlabs.android.player.exceptions.BlocklistException
All Implemented Interfaces:
Serializable

public class BlocklistException extends Exception
Exception thrown when a track is blocklisted.
See Also:
  • Field Details

    • reason

      public final int reason
      The reason why the track was blocklisted.
    • format

      @NonNull public final com.google.android.exoplayer2.Format format
      The format of the blocklisted track.
    • durationMs

      public final long durationMs
      The duration of the blocklisted track in milliseconds.
  • Method Details

    • create

      @NonNull public static BlocklistException create(int reason, @NonNull String message, @NonNull com.google.android.exoplayer2.Format format, long durationMs)
      Creates a new BlocklistException.
      Parameters:
      reason - The reason why the track was blocklisted.
      message - A message describing the reason for the blocklisting.
      format - The format of the blocklisted track.
      durationMs - The duration of the blocklisted track in milliseconds.
      Returns:
      A new BlocklistException.
    • reasonString

      @NonNull public String reasonString()
      Returns a string representation of the reason why the track was blocklisted.
      Returns:
      A string representation of the reason.