Class PublisherKit
- java.lang.Object
-
- com.opentok.android.PublisherKit
-
- All Implemented Interfaces:
java.util.Observer
- Direct Known Subclasses:
Publisher
public class PublisherKit extends java.lang.Object implements java.util.ObserverA 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 theSession.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
Publisherclass, which includes a pre-built video capturer and renderer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePublisherKit.AudioLevelListenerMonitors changes in the audio level of the publisher.static interfacePublisherKit.AudioStatsListenerDefines the listener object for getting publisher audio statistcs.classPublisherKit.AudioTransformerA transformer for an audio stream.static classPublisherKit.BuilderUsed to build aPublisherKitobject.static interfacePublisherKit.CustomAudioTransformerDefines a custom transformer for an audio stream, to be passed into theAudioTransformer(String name, CustomAudioTransformer transformer)constructor.static interfacePublisherKit.CustomVideoTransformerDefines a custom transformer for a video stream, to be passed into theconstructor.static interfacePublisherKit.MuteListenerMonitors when a moderator has forced this publisher to mute audio.static classPublisherKit.PublisherAudioStatsDefines audio statistics for a publisher.static classPublisherKit.PublisherKitVideoTypeDefines values for thesetPublisherVideoType(PublisherKitVideoType type)method.static interfacePublisherKit.PublisherListenerMonitors when a publisher starts and stops streaming to the session.static classPublisherKit.PublisherRtcStatsRepresents RTC statistics for a media stream published by the publisher.static interfacePublisherKit.PublisherRtcStatsReportListenerDefines the listener object for getting publisher RTC stats reports.static classPublisherKit.PublisherVideoStatsDefines video statistics for a publisher.static interfacePublisherKit.VideoListenerMonitors when the publisher starts and stops receiving video data.static interfacePublisherKit.VideoStatsListenerDefines the listener object for getting publisher video statistcs.classPublisherKit.VideoTransformerA transformer for a video stream.
-
Field Summary
Fields Modifier and Type Field Description protected PublisherKit.AudioLevelListeneraudioLevelListenerprotected PublisherKit.AudioStatsListeneraudioStatsListenerprotected BaseVideoCapturercapturerprotected android.content.Contextcontextprotected android.os.Handlerhandlerprotected PublisherKit.MuteListenermuteListenerprotected PublisherKit.PublisherListenerpublisherListenerprotected BaseVideoRendererrendererprotected PublisherKit.PublisherRtcStatsReportListenerrtcStatsReportListenerprotected PublisherKit.VideoListenervideoListenerprotected PublisherKit.VideoStatsListenervideoStatsListener
-
Constructor Summary
Constructors Modifier Constructor Description PublisherKit(android.content.Context context)Deprecated.PublisherKit(android.content.Context context, java.lang.String name)Deprecated.PublisherKit(android.content.Context context, java.lang.String name, boolean audioTrack, boolean videoTrack)Deprecated.protectedPublisherKit(android.content.Context context, java.lang.String name, boolean audioTrack, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer)Deprecated.protectedPublisherKit(android.content.Context context, java.lang.String name, boolean audioTrack, int maxAudioBitRate, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer, boolean enableOpusDtx, boolean scalableScreenshare)Deprecated.protectedPublisherKit(android.content.Context context, java.lang.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddestroy()Deprecated.protected voidfinalize()Called by the garbage collector when it determines that there are no more references to the PublisherKit object.booleangetAudioFallbackEnabled()Deprecated.BaseVideoCapturergetCapturer()Returns the video capturer used by this publisher.java.lang.StringgetName()The stream name.booleangetPublishAudio()Whether the Publisher is publishing audio (true) or not (false).booleangetPublishCaptions()Whether the Publisher is publishing captions (true) or not (false).PublisherKit.PublisherKitVideoTypegetPublisherVideoType()Returns the type of video for this publisher.booleangetPublishVideo()Whether the Publisher is publishing video (true) or not (false).BaseVideoRenderergetRenderer()Returns the video renderer for this publisher.voidgetRtcStatsReport()Gets the RTC stats report for the publisher.SessiongetSession()Returns theSessionbound to this Publisher instance.StreamgetStream()Returns the stream object corresponding the the Publisher's stream.android.view.ViewgetView()Returns the android.view.View object that contains the Publisher video.protected voidonAudioLevelUpdated(float audioLevel)Called periodically to report the audio level of the publisher.protected voidonError(OpentokError error)Invoked when the publisher fails.protected voidonMuteForced()Invoked when a moderator has forced this publisher to mute audio.voidonPause()Do not call directly; callSession.onPause()instead.voidonRestart()Restarts publisher resources that were previously released by calling theonStop()method.voidonResume()Do not call directly; callSession.onResume()instead.protected voidonRtcStatsReport(PublisherKit.PublisherRtcStats[] stats)Called when the publisher's RTC stats report is available in response to a call togetRtcStatsReport().voidonStop()Releases resources tied to the publisher.protected voidonStreamCreated(Stream stream)Invoked when the publisher's stream is created.protected voidonStreamDestroyed(Stream stream)Invoked when the publisher's stream is destroyed.voidsetAudioFallbackEnabled(boolean enabled)Deprecated.voidsetAudioLevelListener(PublisherKit.AudioLevelListener listener)Binds anPublisherKit.AudioLevelListenerto this PublisherKit instance to monitor audio level updates.voidsetAudioStatsListener(PublisherKit.AudioStatsListener listener)Sets up a listener for publisher audio statistics.voidsetAudioTransformers(java.util.ArrayList<PublisherKit.AudioTransformer> audioTransformers)Sets a list of audio transformers to this publisher's audio stream.voidsetCapturer(BaseVideoCapturer newCapturer)Deprecated.voidsetMuteListener(PublisherKit.MuteListener listener)Sets aPublisherKit.MuteListenerobject to monitor when a moderator forces this publisher to mute audio.voidsetName(java.lang.String name)Deprecated.voidsetPublishAudio(boolean publishAudio)Toggles publishing of audio on or off, based on the value passed in.voidsetPublishCaptions(boolean publishCaptions)Toggles publishing of captioning on or off, based on the value passed in.voidsetPublisherListener(PublisherKit.PublisherListener listener)Binds aPublisherKit.PublisherListenerto this Publisher instance to monitor state changes.voidsetPublisherVideoType(PublisherKit.PublisherKitVideoType type)Specifies the type of video for this stream.voidsetPublishVideo(boolean publishVideo)Toggles publishing of video on or off, based on the value passed in.voidsetRenderer(BaseVideoRenderer renderer)Deprecated.voidsetRtcStatsReportListener(PublisherKit.PublisherRtcStatsReportListener listener)Sets the RTC stats report listener the subscriber.voidsetStyle(java.lang.String key, java.lang.String value)Sets a style for the video renderer used by this publisher.voidsetVideoListener(PublisherKit.VideoListener listener)Sets aPublisherKit.VideoListenerobject to monitor when the publisher starts and stops sending video.voidsetVideoStatsListener(PublisherKit.VideoStatsListener listener)Sets up a listener for publisher video statistics.voidsetVideoTransformers(java.util.ArrayList<PublisherKit.VideoTransformer> videoTransformers)Sets a list of video transformers to this publisher's video stream.voidupdate(java.util.Observable o, java.lang.Object arg)This method is called whenever the observed object is changed.
-
-
-
Field Detail
-
handler
protected android.os.Handler handler
-
publisherListener
protected PublisherKit.PublisherListener publisherListener
-
audioLevelListener
protected PublisherKit.AudioLevelListener audioLevelListener
-
videoStatsListener
protected PublisherKit.VideoStatsListener videoStatsListener
-
audioStatsListener
protected PublisherKit.AudioStatsListener audioStatsListener
-
muteListener
protected PublisherKit.MuteListener muteListener
-
rtcStatsReportListener
protected PublisherKit.PublisherRtcStatsReportListener rtcStatsReportListener
-
context
protected android.content.Context context
-
renderer
protected BaseVideoRenderer renderer
-
capturer
protected BaseVideoCapturer capturer
-
videoListener
protected PublisherKit.VideoListener videoListener
-
-
Constructor Detail
-
PublisherKit
@Deprecated protected PublisherKit(android.content.Context context, java.lang.String name, boolean audioTrack, boolean videoTrack, BaseVideoCapturer capturer, BaseVideoRenderer renderer)Deprecated.Creates a new PublisherKit instance. If you extend thePublisherKitclass, 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
PublisherKitobject 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. TheStream.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:
setPublisherListener(PublisherKit.PublisherListener listener)
-
PublisherKit
@Deprecated protected PublisherKit(android.content.Context context, java.lang.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 thePublisherKitclass, 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. TheStream.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, java.lang.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 thePublisherKitclass, 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. TheStream.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 notpublisherAudioFallback- Whether the stream will use the publisher audio-fallback feature (true) or not
-
PublisherKit
@Deprecated public PublisherKit(android.content.Context context, java.lang.String name, boolean audioTrack, boolean videoTrack)Deprecated.Creates a new PublisherKit instance. This method is deprecated. Use thePublisherKit.Builderclass 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. TheStream.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 thePublisherKit.Builderclass 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:
setPublisherListener(PublisherKit.PublisherListener listener)
-
PublisherKit
@Deprecated public PublisherKit(android.content.Context context, java.lang.String name)Deprecated.Creates a new PublisherKit instance. This method is deprecated. Use thePublisherKit.Builderclass 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. TheStream.getName()method for a stream published by this publisher will return this value (on all clients).- See Also:
setPublisherListener(PublisherKit.PublisherListener listener)
-
-
Method Detail
-
onPause
public void onPause()
Do not call directly; callSession.onPause()instead.
-
onResume
public void onResume()
Do not call directly; callSession.onResume()instead.
-
destroy
@Deprecated public void destroy()
Deprecated.Manually destroying the object is not safe. From version 2.17.0 on, this method doesn't do anything. Resources will be automatically released by the garbage collector.
-
setPublishVideo
public void setPublishVideo(boolean publishVideo)
Toggles publishing of video on or off, based on the value passed in.- Parameters:
publishVideo- Whether to publish video (true) or not (false).
-
setPublishAudio
public void setPublishAudio(boolean publishAudio)
Toggles publishing of audio on or off, based on the value passed in.- Parameters:
publishAudio- Whether to publish audio (true) or not (false).
-
setPublishCaptions
public void setPublishCaptions(boolean publishCaptions)
Toggles publishing of captioning on or off, based on the value passed in.- Parameters:
publishCaptions- Whether to publish captions (true) or not (false).
-
setName
@Deprecated public void setName(java.lang.String name)
Deprecated.Set the name for this stream. The name appears at the bottom of the publisher video and at the bottom of subscriber videos associated with the published stream. You can set this name after initializing the publisher and before thePublisherKit.PublisherListener.onStreamCreated(PublisherKit publisher, Stream stream)method is called. Setting the property after thePublisherKit.PublisherListener.onStreamCreated(PublisherKit publisher, Stream stream)method is called has no effect on the name displayed for the stream.The default name is "" (an empty string).
-
setPublisherVideoType
public void setPublisherVideoType(PublisherKit.PublisherKitVideoType type)
Specifies the type of video for this stream. Set this to one of the following values:PublisherKitVideoType.PublisherKitVideoTypeScreen— Optimizes the video encoding for screen sharing. It is recommended to use a low frame rate (5 frames per second or lower) with this video type. When using the screen video type in a session that uses the OpenTok Media Server, you should call thesetAudioFallbackEnabled(boolean enabled)method and pass infalsebefore calling theSession.publish(com.opentok.android.PublisherKit)method; this disables the audio-only fallback feature, so that the video does not drop out in subscribers. See The OpenTok Media Router and media modes.PublisherKitVideoType.PublisherKitVideoTypeCamera— This is the default setting, which you should use when using a camera as the video source.
-
getName
public java.lang.String getName()
The stream name. The name appears at the bottom of Subscriber videos.- Returns:
- publisher name
-
getPublishVideo
public boolean getPublishVideo()
Whether the Publisher is publishing video (true) or not (false).
-
getPublishAudio
public boolean getPublishAudio()
Whether the Publisher is publishing audio (true) or not (false).
-
getPublishCaptions
public boolean getPublishCaptions()
Whether the Publisher is publishing captions (true) or not (false).
-
getSession
public Session getSession()
Returns theSessionbound to this Publisher instance.- Returns:
- The
Sessionbound to this Publisher instance. - See Also:
Session.publish(com.opentok.android.PublisherKit)
-
getStream
public Stream getStream()
Returns the stream object corresponding the the Publisher's stream.- Returns:
- The stream object.
-
getPublisherVideoType
public PublisherKit.PublisherKitVideoType getPublisherVideoType()
Returns the type of video for this publisher.
-
setPublisherListener
public void setPublisherListener(PublisherKit.PublisherListener listener)
Binds aPublisherKit.PublisherListenerto this Publisher instance to monitor state changes.- Parameters:
listener- ThePublisherKit.PublisherListenerthat will monitor this instance, or null to disconnect a listener.
-
setAudioLevelListener
public void setAudioLevelListener(PublisherKit.AudioLevelListener listener)
Binds anPublisherKit.AudioLevelListenerto this PublisherKit instance to monitor audio level updates.- Parameters:
listener- ThePublisherKit.AudioLevelListenerthat will monitor this instance. Set this to null to disconnect a listener and stop monitoring audio levels.
-
setRtcStatsReportListener
public void setRtcStatsReportListener(PublisherKit.PublisherRtcStatsReportListener listener)
Sets the RTC stats report listener the subscriber. SeegetRtcStatsReport().- Parameters:
listener- ThePublisherKit.PublisherRtcStatsReportListenerobject.
-
setVideoTransformers
public void setVideoTransformers(java.util.ArrayList<PublisherKit.VideoTransformer> videoTransformers)
Sets a list of video transformers to this publisher's video stream. If the list is empty, calling this method resets the transformers. The array can be composed by Vonage video transformers provided by ml-library or custom transfomers (see this developer guide). Note: Media transformers are not supported on all devices or Android versions. See this documentation.- Parameters:
videoTransformers- The list of video transformers, in the order to be applied to the stream.
-
setVideoListener
public void setVideoListener(PublisherKit.VideoListener listener)
Sets aPublisherKit.VideoListenerobject to monitor when the publisher starts and stops sending video.- Parameters:
listener- ThePublisherKit.VideoListenerinstance.
-
setAudioTransformers
public void setAudioTransformers(java.util.ArrayList<PublisherKit.AudioTransformer> audioTransformers)
Sets a list of audio transformers to this publisher's audio stream. If the list is empty, calling this method resets the transformers. The array can be composed of Vonage audio transformers provided by ml-library or custom transfomers (see this developer guide). Note: Media transformers are not supported on all devices or Android versions. See this documentation. .- Parameters:
audioTransformers- The list of audio transformers, in the order to be applied to the stream.
-
setStyle
public void setStyle(java.lang.String key, java.lang.String value)Sets a style for the video renderer used by this publisher.By default, there is only one pre-defined style key:
BaseVideoRenderer.STYLE_VIDEO_SCALE. You can set a value for this key to determine the scaling of the video. The following values are supported:-
BaseVideoRenderer.STYLE_VIDEO_FILL— The video scales to fill the entire area of the renderer, with cropping as needed. -
BaseVideoRenderer.STYLE_VIDEO_FIT— The video shrinks, as needed, so that the entire video is visible, with pillarboxing. If you do not set this style the default setting isBaseVideoRenderer.STYLE_VIDEO_FIT.
Calling this method is equivalent to calling
getRenderer().setStyle(). However, if you extend this class, you can override this method to support other styles and behaviors.- Parameters:
key- The style to set.value- The value you are setting the style to.
-
-
setRenderer
@Deprecated public void setRenderer(BaseVideoRenderer renderer)
Deprecated.Sets the video renderer for this publisher.This method is deprecated. Instead, call the
PublisherKit.Builder.renderer(BaseVideoRenderer renderer)method when using the Builder to create the PublisherKit instance.
-
getRenderer
public BaseVideoRenderer getRenderer()
Returns the video renderer for this publisher.
-
getCapturer
public BaseVideoCapturer getCapturer()
Returns the video capturer used by this publisher.
-
setCapturer
@Deprecated public void setCapturer(BaseVideoCapturer newCapturer)
Deprecated.Sets the video capturer for this publisher.This method is deprecated. Instead, call the
PublisherKit.Builder.capturer(BaseVideoCapturer capturer)method when using the builder to create the PublisherKit instance.
-
getView
public android.view.View getView()
Returns the android.view.View object that contains the Publisher video.
-
setVideoStatsListener
public void setVideoStatsListener(PublisherKit.VideoStatsListener listener)
Sets up a listener for publisher video statistics. The listener object implements thePublisherKit.VideoStatsListener.onVideoStats(PublisherKit publisher, PublisherKit.PublisherVideoStats[] stats)method. This method is called periodically to report the following:- Total video packets lost
- Total video packets sent
- Total video bytes sent
-
setAudioStatsListener
public void setAudioStatsListener(PublisherKit.AudioStatsListener listener)
Sets up a listener for publisher audio statistics. The listener object implements thePublisherKit.AudioStatsListener.onAudioStats(PublisherKit publisher, PublisherKit.PublisherAudioStats[] stats)method. This method is called periodically to report the following:- Total audio packets lost
- Total audio packets sent
- Total audio bytes sent
-
setMuteListener
public void setMuteListener(PublisherKit.MuteListener listener)
Sets aPublisherKit.MuteListenerobject to monitor when a moderator forces this publisher to mute audio.- Parameters:
listener- ThePublisherKit.MuteListenerinstance.
-
setAudioFallbackEnabled
@Deprecated public void setAudioFallbackEnabled(boolean enabled)
Deprecated.Whether the stream will use the subscriber audio-fallback feature (true) or not (false). The audio-fallback feature is available in sessions that use the the OpenTok Media Router. With the audio-fallback feature enabled (the default), when the OpenTok Media Router determines that a stream's quality has degraded significantly for a specific subscriber, it disables the video in that subscriber in order to preserve audio quality.The default setting is
true(the audio-fallback feature is enabled). To turn off the audio-fallback feature, call this method (and pass infalse) before calling theSession.publish(com.opentok.android.PublisherKit)method.
-
getAudioFallbackEnabled
@Deprecated public boolean getAudioFallbackEnabled()
Deprecated.Whether the stream uses the subscriber audio-fallback feature (true) or not (false).- See Also:
setAudioFallbackEnabled(boolean enabled)
-
getRtcStatsReport
public void getRtcStatsReport()
Gets the RTC stats report for the publisher. This is an asynchronous operation. Call thesetRtcStatsReportListener(PublisherKit.PublisherRtcStatsReportListener listener)method, and then implement thePublisherKit.PublisherRtcStatsReportListener.onRtcStatsReport(PublisherKit publisher, PublisherKit.PublisherRtcStats[] stats)method prior to calling this method. When the stats are available, the implementation of thePublisherKit.PublisherRtcStatsReportListener.onRtcStatsReport(PublisherKit publisher, PublisherKit.PublisherRtcStats[] stats)method is called.Also see
setAudioStatsListener(PublisherKit.AudioStatsListener listener),setVideoStatsListener(PublisherKit.VideoStatsListener listener), andSubscriberKit.getRtcStatsReport().
-
onRtcStatsReport
protected void onRtcStatsReport(PublisherKit.PublisherRtcStats[] stats)
Called when the publisher's RTC stats report is available in response to a call togetRtcStatsReport().If you extend the PublisherKit class, you can override this method instead of implementing the onRtcStatsReport() method of the PublisherKit.PublisherRtcStatsReportListener interface.
-
onStreamCreated
protected void onStreamCreated(Stream stream)
Invoked when the publisher's stream is created.If you extend the PublisherKit class, you can override this method instead of the
onStreamCreated()method of the PublisherKit.PublisherListener interface.- Parameters:
stream- The stream that that is created.
-
onStreamDestroyed
protected void onStreamDestroyed(Stream stream)
Invoked when the publisher's stream is destroyed.If you extend the PublisherKit class, you can override this method instead of the
onStreamDestroyed()method of the PublisherKit.PublisherListener interface.- Parameters:
stream- The stream that that is destroyed.
-
onError
protected void onError(OpentokError error)
Invoked when the publisher fails.If you extend the PublisherKit class, you can override this method instead of the
onError()method of the PublisherKit.PublisherListener interface.- Parameters:
error- The error that invoked this callback.
-
onAudioLevelUpdated
protected void onAudioLevelUpdated(float audioLevel)
Called periodically to report the audio level of the publisher.- Parameters:
audioLevel- The audio level, from 0 to 1.0. Adjust this value logarithmically for use in a user interface visualization (such as a volume meter).
-
onMuteForced
protected void onMuteForced()
Invoked when a moderator has forced this publisher to mute audio.If you extend the PublisherKit class, you can override this method instead of the
onMuteForced()method of the PublisherKit.MuteListener interface.
-
update
public void update(java.util.Observable o, java.lang.Object arg)This method is called whenever the observed object is changed. This class implements the Observer interface, so it observes events, such as the session pause and session resume events.- Specified by:
updatein interfacejava.util.Observer- Parameters:
o- The observable object.arg- An argument passed to the notifyObservers method.
-
finalize
protected void finalize() throws java.lang.ThrowableCalled by the garbage collector when it determines that there are no more references to the PublisherKit object.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
onStop
public void onStop()
Releases resources tied to the publisher. Calling this method causes the publisher to stop capturing, and then it releases the camera. To reuse the publisher after calling this method, call theonRestart()method.
-
onRestart
public void onRestart()
Restarts publisher resources that were previously released by calling theonStop()method.
-
-