API Reference

Complete API reference for ConoStream SDK classes and interfaces.

ConoStreamManager

The main class for managing room connections and basic audio/video publishing. Initialize once in your Application class for app-wide access.

Constructor

Method Parameters Description
ConoStreamManager() Context context Creates a new manager instance

Connection Methods

Method Parameters Description
connect() String url, String token, ConoStreamEventListener listener Connect to a streaming room
disconnect() - Disconnect from current room
leaveRoom() - Leave and cleanup room resources
isConnected() - Returns boolean - connection state

Audio Methods

Method Parameters Description
publishMicrophone() - Start publishing microphone audio
unpublishMicrophone() - Stop publishing microphone audio
muteMicrophone() boolean mute Mute or unmute microphone
isMicrophoneMuted() - Returns boolean - mute state
configureAudioForSpeaker() - Configure audio output for speaker mode

Room Access

Method Returns Description
getRoom() Room Get the current room instance
getLocalParticipant() LocalParticipant Get local participant
getRemoteParticipants() List<RemoteParticipant> Get all remote participants

Lifecycle

Method Description
release() Release all resources. Call when done with streaming.

ConoStreamAudioHelper

Helper class for audio room functionality including co-hosting.

Constructor

Method Parameters
ConoStreamAudioHelper() ConoStreamManager manager, Activity activity

Methods

Method Parameters Description
joinAsHost() String url, String token, String channel Join room as host (publishes audio)
joinAsAudience() String url, String token, String channel Join room as audience (listen only)
upgradeToCoHost() - Upgrade audience to co-host
downgradeToAudience() - Downgrade co-host back to audience
leaveRoom() - Leave the audio room
setEventCallback() ConoStreamEventCallback callback Set event listener

ConoStreamVideoHelper

Helper class for video room functionality including PK battles.

Constructor

Method Parameters
ConoStreamVideoHelper() ConoStreamManager manager, Activity activity

Connection Methods

Method Parameters Description
joinAsHost() String url, String token, String channel, TextureViewRenderer localView Join as host with camera
joinAsAudience() String url, String token, String channel Join as audience
release() - Release all video resources

Camera Methods

Method Parameters Description
switchCamera() - Toggle front/back camera
enableCamera() boolean enable Enable or disable camera
isCameraEnabled() - Returns camera state
setVideoProcessor() VideoProcessor processor Set beauty filter processor

PK Battle Methods

Method Parameters Description
joinPkOpponentRoom() String url, String token, String channel Connect to opponent's room for PK
attachLocalVideoToPkView() TextureViewRenderer view Attach local video to PK left side
attachPkRemoteVideoToView() TextureViewRenderer view Attach opponent video to PK right side
leavePkOpponentRoom() - Disconnect from PK opponent room
cleanupPkRenderers() - Cleanup PK video renderers

ConoStreamMusicMixer

Mix background music with live audio stream.

Methods

Method Parameters Description
startMusic() String filePath Start playing background music
stopMusic() - Stop background music
pauseMusic() - Pause background music
resumeMusic() - Resume paused music
setMusicVolume() float volume Set music volume (0.0 - 1.0)
setMicrophoneVolume() float volume Set mic volume (0.0 - 1.0)

ConoStreamEventListener

Basic event listener for room connection events.

public interface ConoStreamEventListener {
    void onConnected();
    void onDisconnected();
    void onError(String error);
    void onReconnecting();
    void onReconnected();
}

ConoStreamEventCallback

Extended callback for audio room events.

public interface ConoStreamEventCallback {
    void onAudioTrackPublished();
    void onRemoteAudioTrackSubscribed(String participantId);
    void onRemoteAudioTrackUnsubscribed(String participantId);
    void onParticipantJoined(String participantId, String name);
    void onParticipantLeft(String participantId, String name);
    void onConnectionError(String error);
}

ConoStreamVideoEventCallback

Extended callback for video room events.

public interface ConoStreamVideoEventCallback {
    void onLocalVideoTrackPublished();
    void onRemoteVideoTrackSubscribed(String participantId, VideoTrack track);
    void onRemoteVideoTrackUnsubscribed(String participantId);
    void onParticipantJoined(String participantId, String name);
    void onParticipantLeft(String participantId, String name);
    void onPkOpponentConnected(String participantId);
    void onPkOpponentDisconnected(String participantId);
}

Room

Represents a streaming room where participants connect and share media.

Properties

Property Type Description
name String Unique room identifier
sid String Server-assigned room session ID
state RoomState Current connection state (CONNECTING, CONNECTED, DISCONNECTED, RECONNECTING)
localParticipant LocalParticipant The current user's participant object
remoteParticipants Map<String, RemoteParticipant> Map of all remote participants by identity
metadata String Custom room metadata (JSON string)

Methods

Method Returns Description
disconnect() void Disconnect from the room
getParticipantCount() int Total number of participants including local

Participant

Represents a user in the room. Can be LocalParticipant (you) or RemoteParticipant (others).

Properties

Property Type Description
identity String Unique participant identifier
sid String Server-assigned participant session ID
name String Display name
metadata String Custom participant metadata
isSpeaking boolean Whether participant is currently speaking
audioLevel float Current audio level (0.0 - 1.0)
connectionQuality ConnectionQuality Network connection quality (EXCELLENT, GOOD, POOR)

Methods

Method Returns Description
getTrackPublications() List<TrackPublication> Get all track publications
getAudioTracks() List<AudioTrack> Get all audio tracks
getVideoTracks() List<VideoTrack> Get all video tracks

LocalParticipant Additional Methods

Method Parameters Description
publishAudioTrack() LocalAudioTrack track Publish an audio track
publishVideoTrack() LocalVideoTrack track Publish a video track
unpublishTrack() Track track Unpublish a track
setMicrophoneEnabled() boolean enabled Enable/disable microphone
setCameraEnabled() boolean enabled Enable/disable camera

Track

Represents a media track (audio or video) published by a participant.

Track Types

Type Description
AudioTrack Audio stream from microphone or file
VideoTrack Video stream from camera or screen
LocalAudioTrack Local audio track that can be published
LocalVideoTrack Local video track that can be published
RemoteAudioTrack Remote audio track (auto-plays when subscribed)
RemoteVideoTrack Remote video track (attach to renderer)

Properties

Property Type Description
sid String Server-assigned track session ID
name String Track name
kind TrackKind AUDIO or VIDEO
source TrackSource MICROPHONE, CAMERA, SCREEN_SHARE
muted boolean Whether track is muted

VideoTrack Methods

Method Parameters Description
addRenderer() TextureViewRenderer renderer Attach video to a view
removeRenderer() TextureViewRenderer renderer Detach video from a view

LocalVideoTrack Methods

Method Parameters Description
setEnabled() boolean enabled Enable/disable the track
setVideoProcessor() VideoProcessor processor Set beauty filter processor
switchCamera() - Switch front/back camera