Class SubtitlesPlugin


public class SubtitlesPlugin extends Plugin
This plugin provides support for extended Subtitles within the Castlabs SDK.

Before you can use this plugin, you need to register it with the PlayerSDK before you initialize the SDK itself. For example:

     PlayerSDK.register(new SubtitlesPlugin());

Since version 4.0.2, this plugin also registers a for a SubtitlesViewComponent to allow access to the underlying view that shows the subtitles on screen. If you're not using a PlayerView, you can use the SubtitlesPlugin.SubtitlesPluginComponent to get access to the underlying SubtitlesView. In order to do this, create a SubtitlesView either programmatically or by declaring it in a layout file, and PlayerController.setComponentView(int, View) it to the PlayerController passing the SUBTITLES_VIEW_ID as identifier.

  • Field Details


      @IdRes public static final int SUBTITLES_VIEW_ID
      View ID for the default SubtitlesView
  • Constructor Details

    • SubtitlesPlugin

      public SubtitlesPlugin()
  • Method Details

    • getId

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

      public boolean isEnabled()
      True if the plugin is enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Enabled or disable the plugin
      enabled - new state