Class MediaSegmentView

java.lang.Object
android.view.View
com.castlabs.sdk.debug.view.MediaSegmentView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback

public class MediaSegmentView extends View
Simple view that renders a media segment as a line with its relative position and duration
  • Constructor Details

    • MediaSegmentView

      public MediaSegmentView(Context context)
      Creates a new MediaSegmentView.
      Parameters:
      context - The context to use.
    • MediaSegmentView

      public MediaSegmentView(Context context, @Nullable AttributeSet attrs)
      Creates a new MediaSegmentView.
      Parameters:
      context - The context to use.
      attrs - The attributes to use.
    • MediaSegmentView

      public MediaSegmentView(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
      Creates a new MediaSegmentView.
      Parameters:
      context - The context to use.
      attrs - The attributes to use.
      defStyleAttr - The default style attribute.
    • MediaSegmentView

      public MediaSegmentView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes)
      Creates a new MediaSegmentView.
      Parameters:
      context - The context to use.
      attrs - The attributes to use.
      defStyleAttr - The default style attribute.
      defStyleRes - The default style resource.
  • Method Details

    • setTimes

      public void setTimes(long startTimeMs, long endTimeMs, long durationMs, @ColorInt int color)
      Sets the start and end times for the media segment, as well as the total duration and color. These values are used to calculate the position and length of the segment on the view.
      Parameters:
      startTimeMs - The start time of the media segment in milliseconds.
      endTimeMs - The end time of the media segment in milliseconds.
      durationMs - The total duration of the media in milliseconds.
      color - The color to use for rendering the segment.