Class SubtitleViewWrapper

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class SubtitleViewWrapper extends FrameLayout
Deprecated.
You should create the SubtitlesView directly, either programmatically or by declaring it in a layout file. If you create the SubtitlesView programmatically, it can be injected onto the SDK through the PlayerController.setComponentView(int, View) method passing SubtitlesPlugin.SUBTITLES_VIEW_ID as viewId.
Wraps around a SubtitlesView.

You can create this view both programmatically or by defining it in your xml layout file.

On layout inflation (or view creation) you have to bind the view to the ViewController. When you don't need the SubtitlesView anymore, for instance in onDestroy, you should unbind the view.

Since:
4.2.0
  • Constructor Details

    • SubtitleViewWrapper

      public SubtitleViewWrapper(Context context)
      Deprecated.
    • SubtitleViewWrapper

      public SubtitleViewWrapper(Context context, @Nullable AttributeSet attrs)
      Deprecated.
    • SubtitleViewWrapper

      public SubtitleViewWrapper(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
      Deprecated.
    • SubtitleViewWrapper

      @RequiresApi(21) public SubtitleViewWrapper(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes)
      Deprecated.
  • Method Details

    • bindToPlayerController

      public void bindToPlayerController(@NonNull PlayerController playerController)
      Deprecated.
      Binds to the provided PlayerController. Internally it creates a SubtitlesView, adds it to itself and sets it in the PlayerController with the corresponding id.

      You should call unbindFromPlayerController() when you don't need the SubtitlesView anymore.

      Parameters:
      playerController - the PlayerController
    • unbindFromPlayerController

      public void unbindFromPlayerController()
      Deprecated.
      Removes the SubtitlesView and unsets it in the PlayerController.
    • setMeasuredVideoDimensions

      public void setMeasuredVideoDimensions(int width, int height)
      Deprecated.
      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
    • getSubtitlesView

      @Nullable public com.castlabs.sdk.base.subtitles.SubtitlesView getSubtitlesView()
      Deprecated.
      Returns the underlying SubtitlesView if any, null otherwise.
      Returns:
      the underlying SubtitlesView or null