Class SubtitlesView

    • Constructor Detail

      • SubtitlesView

        public SubtitlesView​(@NonNull
                             Context context)
      • SubtitlesView

        public SubtitlesView​(Context context,
                             @Nullable
                             AttributeSet attrs,
                             int defStyleAttr)
      • SubtitlesView

        public SubtitlesView​(Context context,
                             @Nullable
                             AttributeSet attrs,
                             int defStyleAttr,
                             int defStyleRes)
    • Method Detail

      • setJNIHelper

        public void setJNIHelper​(com.castlabs.sdk.subtitles.SubtitleParserHelper jniHelper)
      • setImagePool

        public void setImagePool​(com.castlabs.sdk.subtitles.ImagePool imagePool)
      • onStyleChange

        public void onStyleChange​(@Nullable
                                  SubtitlesStyle overrideStyle)
        Set the user settings that override or customise the subtitles appearance
        Parameters:
        overrideStyle - Subtitle style to set
      • setDebugRendering

        public void setDebugRendering​(boolean enabled)
        Enable or disable debug rendering
        Parameters:
        enabled - Enable or disable debug rendering
      • setMeasuredVideoDimensions

        public void setMeasuredVideoDimensions​(int width,
                                               int height)
        Informs the subtitle render context about the video dimensions. This is usually the video Surface dimensions.
        Parameters:
        width - width in pixels
        height - height in pixels
      • parse

        public void parse​(String mimeType,
                          byte[] subtitlesContent,
                          String baseUrl,
                          long positionOffsetUs)
                   throws Exception
        Throws:
        Exception
      • update

        public void update​(long playerPositionUs)
        Check for visibility changes to any of the subtitles If any subtitle changes state to become hidden or visible then the view will be rendered
        Parameters:
        playerPositionUs - The target position in microseconds