The EnxStream is a derived Class from EnxRtc. It handles all the Media Stream-related functions to initiate, configure, and transport Streams to EnableX Media Servers. It is also used for receiving Stream endpoints to be played.

References: AttributesMethodsObservers

Private Attributes

  • id – Unique Stream ID.
  • local – Boolean. True for Local Stream, False for Remote Stream.
  • room – JSON Object. Room with which the Stream is associated.
  • showing – Boolean. Whether the stream is being played.
  • audio – Boolean. True if the stream carries Audio Track.
  • video – Boolean. True if the stream carries Video Track.
  • screen – Boolean. True if the stream carries Screen Share.
  • videoSize – Size of Video Frame, defined as [minWidth, minHeight, maxWidth, maxHeight].
  • videoFrameRate – Frame Rate of Video Stream, defined as [min, max].
  • desktopStreamId – Chrome Media Source ID to be used for Screen Share.
  • extensionId – Extension ID to be used for Screen Share.
  • audioMuted – Boolean. True if Audio is muted
  • videoMuted – Boolean. True if Video is muted
  • attributes – videoFrameRate

Methods

A categorized listing of Stream Handler methods is as given below:

Stream Information

  • getId() – To get Stream ID.
  • getAttributes() – To get all attributes of the Stream.
  • getMedia() – To get Audio and Video tracks.
  • getState() – To get the current state of the Stream.
  • hasAudio() – To know if the Stream has an Audio track.
  • hasVideo() – To know if the Stream has a Video track.
  • hasData() – To know if the Stream has Text Data.
  • hasScreen() – To know if the Stream has Screen Share.
  • isLocal() – To know if the Stream is a Local Stream.
  • isAudioActive() – To know if the Audio Track is currently active.
  • isVideoActive() – To know if the Video Track is currently active.

Stream Controls

Moderator Controls

  • hardMuteAudio() – To hard mute a Participant’s audio
  • hardMuteVideo() – To hard mute a Participant’s video
  • hardunMuteAudio() – To lift the audio hard-mute restriction from the Participant.
  • hardUnmuteVideo() – To lift the video hard-mute restriction from the Participant.

Miscellaneous

Observers & their Callbacks

Stream Observer

Given below is a category-wise listing of Stream Observer Callbacks based on their functions. The Room Observer is initiated along with Room Initialization Process.

Streaming

  • onRemoteStreamAudioMute() – Notification to everyone in the Room when a user’s audio is muted.
  • onRemoteStreamAudioUnMute() – Notification to everyone in the Room when a user’s audio is unmuted.
  • onAudioEvent() – Notification to the stream publisher when the Audio track is muted/unmuted.
  • onVideoEvent() – Notification to the stream publisher when the Video track is muted/unmuted.

Messaging

  • onReceivedData() – When text messages are received.

Hard Mute Audio Observer

ObserverEnxStream.setMuteAudioStreamObserver(EnxMuteAudioStreamObserver-Object) – To receive the following callbacks:

  • onHardMutedAudio – Acknowledgment to the Moderator when the Participant’s Audio Stream is hard-muted.
  • onHardUnMutedAudio – Acknowledgment to the Moderator when the hard-mute restriction is lifted from the Participant’s Audio Stream.
  • onReceivedHardMuteAudio – Notification to the Participant when the Moderator hard-mutes their Audio Stream.
  • onReceivedHardUnMuteAudio – Notification to the Participant when the Moderator lifts the hard-mute restriction from their Audio Stream.

Hard Mute Video Observer

ObserverEnxStream.setMuteVideoStreamObserver(EnxMuteVideoStreamObserver-Object) – To receive the following callbacks:

  • onHardMutedVideo – Acknowledgment to the Moderator when the Participant’s Video Stream is hard-muted.
  • onHardUnMutedVideo – Acknowledgment to the Moderator when the hard-mute restriction is lifted from the Participant’s Video Stream.
  • onReceivedHardMuteVideo – Notification to the Participant when the Moderator hard-mutes their Video Stream.
  • onReceivedHardUnMuteVideo – Notification to the Participant when the Moderator lifts the hard-mute restriction from their Video Stream.

Explore Android SDK