Class PublisherKit

java.lang.Object
com.opentok.android.PublisherKit
All Implemented Interfaces:
Observer
Direct Known Subclasses:
Publisher

public class PublisherKit extends Object implements Observer
A publisher captures an audio-video stream from the sources you specify. You can then publish the audio-video stream to an OpenTok session by calling the Session.publish(PublisherKit publisher) method.

Create a subclass of PublisherKit if you are interested in providing your own video capturing and rendering implementation. Otherwise, use the Publisher class, which includes a pre-built video capturer and renderer.

  • Field Details

  • Constructor Details

    • PublisherKit

      @Deprecated protected PublisherKit(android.content.Context context, String name, boolean audioTrack, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer)
      Deprecated.
      Creates a new PublisherKit instance. If you extend the PublisherKit class, you can call this constructor to instantiate a publisher object.

      Use the Session.publish(PublisherKit publisher) method to start streaming from this publisher into a session.

      The getView() method returns the android.view.View object containing the published video.

      Publishers cannot be reused. Instantiate a new PublisherKit object each time you want to publish a new stream.

      Parameters:
      context - The android.content.Context for the Publisher.
      name - The name of the publisher video. The Stream.getName() method for a published by this publisher will return this value (on all clients).
      audioTrack - Whether to include an audio track in the published stream.
      videoTrack - Whether to include a video track in the published stream.
      capturer - The video capturer for the publisher.
      renderer - The video renderer for the publisher.
      See Also:
    • PublisherKit

      @Deprecated protected PublisherKit(android.content.Context context, String name, boolean audioTrack, int maxAudioBitRate, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer, boolean enableOpusDtx, boolean scalableScreenshare)
      Deprecated.
      Creates a new PublisherKit object. If you extend the PublisherKit class, you can call this constructor from the child class.
      Parameters:
      context - The android.content.Context for the Publisher.
      name - The name of the publisher video. The Stream.getName() method for a published by this publisher will return this value (on all clients).
      audioTrack - Whether to include an audio track in the published stream.
      maxAudioBitRate - The desired bitrate of the audio, in bits per second.
      videoTrack - Whether to include a video track in the published stream.
      capturer - The video capturer for the publisher.
      renderer - The video renderer for the publisher.
      scalableScreenshare - Whether to allow use of scalable video for a publisher that has the videoType set to PublisherKitVideoTypeScreen (true) or not (false, the default).
    • PublisherKit

      protected PublisherKit(android.content.Context context, String name, boolean audioTrack, int maxAudioBitRate, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer, boolean enableOpusDtx, boolean scalableScreenshare, boolean subscriberAudioFallback, boolean publisherAudioFallback)
      Creates a new PublisherKit object. If you extend the PublisherKit class, you can call this constructor from the child class.
      Parameters:
      context - The android.content.Context for the Publisher.
      name - The name of the publisher video. The Stream.getName() method for a published by this publisher will return this value (on all clients).
      audioTrack - Whether to include an audio track in the published stream.
      maxAudioBitRate - The desired bitrate of the audio, in bits per second.
      videoTrack - Whether to include a video track in the published stream.
      capturer - The video capturer for the publisher.
      renderer - The video renderer for the publisher.
      scalableScreenshare - Whether to allow use of scalable video for a publisher that has the videoType set to PublisherKitVideoTypeScreen (true) or not (false, the default).
      subscriberAudioFallback - Whether the stream will use the subscriber audio-fallback feature (true) or not
      publisherAudioFallback - Whether the stream will use the publisher audio-fallback feature (true) or not
    • PublisherKit

      @Deprecated public PublisherKit(android.content.Context context, String name, boolean audioTrack, boolean videoTrack)
      Deprecated.
      Creates a new PublisherKit instance. This method is deprecated. Use the PublisherKit.Builder class to instantiate a PublisherKit object.

      Use the Session.publish(PublisherKit publisher) method to start streaming from this publisher into a session.

      This version of the constructor adds parameters that let you exclude the audio track or video track from the published stream. Creating a Publisher without an audio track or video track can save CPU resources.

      The getView() method returns the android.view.View object containing the published video.

      Publishers cannot be reused.

      Parameters:
      context - The android.content.Context for the Publisher.
      name - The name of the publisher video. The Stream.getName() method for a stream published by this publisher will return this value (on all clients).
      audioTrack - Whether to include an audio track in the published stream.
      videoTrack - Whether to include a video track in the published stream.
    • PublisherKit

      @Deprecated public PublisherKit(android.content.Context context)
      Deprecated.
      Creates a new PublisherKit instance. This method is deprecated. Use the PublisherKit.Builder class to instantiate a PublisherKit object.

      Use the Session.publish(PublisherKit publisher) method to start streaming from this publisher into a session.

      The getView() method returns the android.view.View object containing the published video.

      Parameters:
      context - The android.content.Context for the Publisher.
      See Also:
    • PublisherKit

      @Deprecated public PublisherKit(android.content.Context context, String name)
      Deprecated.
      Creates a new PublisherKit instance. This method is deprecated. Use the PublisherKit.Builder class to instantiate a PublisherKit object.

      Use the Session.publish(PublisherKit publisher) method to start streaming from this publisher into a session.

      The getView() method returns the android.view.View object containing the published video.

      Parameters:
      context - The android.content.Context for the Publisher.
      name - The name of the publisher video. The Stream.getName() method for a stream published by this publisher will return this value (on all clients).
      See Also:
  • Method Details