Class BaseVideoRenderer

java.lang.Object
com.opentok.android.BaseVideoRenderer

public abstract class BaseVideoRenderer extends Object
Defines a video renderer to be used by a PublisherKit object or a SubscriberKit object.
See Also:
  • Field Details Link icon

  • Constructor Details Link icon

    • BaseVideoRenderer Link icon

      public BaseVideoRenderer()
  • Method Details Link icon

    • onFrame Link icon

      public abstract void onFrame(BaseVideoRenderer.Frame frame)
      Called when a frame is rendered for the stream.
      Parameters:
      frame - The video frame. Call the getBuffer method of this object to get the frame data, which is in I420 format.
    • setStyle Link icon

      public abstract void setStyle(String key, String value)
      Set a style for this video renderer. By default, there is only one pre-defined style key: STYLE_VIDEO_SCALE. You can set a value for this key to determine the scaling of the video. The following values are supported:
      • STYLE_VIDEO_FILL — The video scales to fill the entire area of the renderer, with cropping as needed.
      • STYLE_VIDEO_FIT — The video shrinks, as needed, so that the entire video is visible, with pillarboxing (the default setting).

      You can extend this class and override this method to support other styles and behaviors.

      Parameters:
      key - The style to set.
      value - The value you are setting the style to.
    • onVideoPropertiesChanged Link icon

      public abstract void onVideoPropertiesChanged(boolean videoEnabled)
      Called when the stream changes between having video and not having video (audio-only).
      Parameters:
      videoEnabled - Whether the stream has video (true) or not (false).
    • getView Link icon

      public abstract android.view.View getView()
      Returns the View containing the video.
    • onPause Link icon

      public abstract void onPause()
      Call this method when the activity pauses. When you override this method, implement code to respond to the activity being paused. For example, you may pause rendering audio or video.
      See Also:
    • onResume Link icon

      public abstract void onResume()
      Call this method when the activity resumes. When you override this method, implement code to respond to the activity being resumed. For example, you may resume rendering audio or video.
      See Also: