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

References: AttributesMethodsEvents

Attributes

  • id – Unique Stream ID
  • local – Boolean. True for Local Stream; False for Remote Stream
  • room – JSON Object. Room Into to which the Stream is associated
  • showing – Boolean. Whether the stream is being played
  • audio – Boolean. True if the stream has Audio Track
  • video – Boolean. True if the stream has Video Track
  • screen – Boolean. True if the stream has 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

Given below a categorized listing of methods:

Basics

  • init() – To initiate a local Stream for publishing
  • close() – To closes the local Stream, stops publishing too
  • play() – To play Video in EnableX Player in a given DOM ID
  • stop() – To stop playing Video in EnableX Player

Stream Information

  • getId() – To get Stream ID
  • getAttributes() – To get all attributes of the Stream
  • ifAudio() – To know if the stream has Audio
  • ifVideo() – To know if the stream has Video
  • ifData() – To know if the stream has Text Data
  • ifScreen() – To know if the stream has Screen Share
  • ifMedia() – To know if the stream has Audio, Video or Screen Share

Stream Controls

  • setAttributes() – To update / set attributes of own published stream
  • updateConfiguration() – To update bandwidth requirement for audio and video for published stream
  • muteAudio() – To mute audio of own published stream
  • muteVideo() – To mute video of own published stream
  • unmuteAudio() – To unmute audio of own published stream
  • unmuteVideo() – To unmute video of own published stream

Miscellaneous

  • sendData() – To send plain text data with the Stream
  • getVideoFrameImage() – To take a Raw Image Snapshot of Stream into Canvas Object
  • switchMicrophone() – To switch Audio source of your published Stream to another Microphone
  • switchCamera() – To switch Video source of your published Stream to another Camera

Events

Given below a categorized listing of events:

Stream Controls

  • media-access-allowed – When access is granted to Camera, Microphone
  • media-access-denied – When access is denied for Camera, Microphone
  • stream-attributes-updated – When local stream attributes are updated

Explore Web SDK