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: AttributesMethodsEvents

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:

Basics

  • close() – To close and stop publishing the local Stream.
  • play() – To play Video on EnableX Player in a given DOM ID.
  • stop() – To stop playing Video on EnableX Player.

Stream Information

  • getId()– This method provides the ID of the given Stream.
  • getAttributes() – To get all attributes of the Stream.
  • ifAudio() – To know if the stream has an Audio Track.
  • ifVideo() – To know if the stream has a Video Track.
  • ifData() – To know if the stream has Text Data.
  • ifScreen() – To know if the stream has Screen Share.

Stream Controls

Miscellaneous

  • getVideoFrameImage() – To take a Raw Image Snapshot of Stream into Canvas Object.
  • switchMicrophone() – To switch Audio source of local Stream to another Microphone connected to the device.
  • switchCamera() – To switch Video source of local Stream to another Camera connected to the device.

Events

Stream Controls

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