The EnxStream is a derived Class from EnxRtc. It handles all the Media Stream-related functions to initiate, configure, and transport Streams to Media Servers. It is also used for receiving Stream endpoints to be played.
References: Attributes – Methods – Events
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
– To close and stop publishing the local Stream.()close– To play Video on the Player in a given DOM ID.play()– To stop playing Video on the Player.stop()
Stream Information
– This method provides the ID of the given Stream.getId()– To get all attributes of the Stream.getAttributes()– To know if the stream has an Audio Track.()ifAudio– To know if the stream has a Video Track.()ifVideo– To know if the stream has Text Data.()ifData– To know if the stream has Screen Share.()ifScreen
Stream Controls
– To update / set attributes of local Stream.setAttributes()– To update bandwidth requirement for audio and video for local Stream.()updateConfiguration– To mute audio of local Stream.()muteAudio– To mute video of local Stream.()muteVideo– To unmute audio of local Stream.()unmuteAudio– To unmute video of local Stream.()unmuteVideo
Miscellaneous
– To take a Raw Image Snapshot of Stream into Canvas Object.()getVideoFrameImageswitchMicrophone()– 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.
