ECStream Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | ECStream.h ECStream.m |
Overview
@interface ECStream
Represents a wrapper around an audio/video RTC stream that can be used to access local media and publish it in a ECRoom, or receive video from.
Initializers
– initLocalStreamVideoConstraints:audioConstraints:
Creates an instace of ECStream capturing audio/video from the host device with given Audio and Video contraints.
- (instancetype _Nonnull)initLocalStreamVideoConstraints:(nullable RTCMediaConstraints *)videoConstraints audioConstraints:(nullable RTCMediaConstraints *)audioConstraintsParameters
videoConstraints |
RTCMediaConstraints that apply to this stream. |
|---|---|
audioConstraints |
RTCMediaConstraints that apply to this stream. |
Return Value
instancetype
Discussion
Notice that the constraints passed to this initializer will also be set as default constraint properties for defaultAudioConstraints and defaultVideoConstraints.
Declared In
ECStream.h
– initLocalStreamWithOptions:attributes:videoConstraints:audioConstraints:
Creates an instace of ECStream capturing audio/video from the host device providing options, attributes and Audio and Video contraints.
- (instancetype _Nonnull)initLocalStreamWithOptions:(nullable NSDictionary *)options attributes:(nullable NSDictionary *)attributes videoConstraints:(nullable RTCMediaConstraints *)videoConstraints audioConstraints:(nullable RTCMediaConstraints *)audioConstraintsParameters
options |
dictionary. @see kStreamOption for options keys. |
|---|---|
attributes |
dictionary. @see setAttributes. |
videoConstraints |
RTCMediaConstraints that apply to this stream. |
audioConstraints |
RTCMediaConstraints that apply to this stream. |
Return Value
instancetype
Discussion
Notice that the constraints passed to this initializer will also be set as default constraint properties for defaultAudioConstraints and defaultVideoConstraints.
Declared In
ECStream.h
– initLocalStreamWithOptions:attributes:
Creates an instace of ECStream capturing audio/video from the host device providing options, attributes.
- (instancetype _Nonnull)initLocalStreamWithOptions:(nullable NSDictionary *)options attributes:(nullable NSDictionary *)attributesParameters
options |
dictionary. @see kStreamOption for options keys. |
|---|---|
attributes |
dictionary. @see setAttributes. |
Return Value
instancetype
See Also
Declared In
ECStream.h
– initLocalStream
Creates an instance of ECStream capturing audio/video data from host device with defaultVideoConstraints and defaultAudioConstraints.
- (instancetype _Nonnull)initLocalStreamReturn Value
instancetype
Declared In
ECStream.h
– initWithStreamId:attributes:signalingChannel:
Creates an instance of ECStream with a given stream id and signaling channel.
- (instancetype _Nonnull)initWithStreamId:(nonnull NSString *)streamId attributes:(nullable NSDictionary *)attributes signalingChannel:(nonnull ECSignalingChannel *)signalingChannelParameters
streamId |
Erizo stream id for this stream object. |
|---|---|
attributes |
Stream attributes. Attributes will not be sent to the server. |
signalingChannel |
Signaling channel used by ECRoom that handles the stream. |
Return Value
instancetype
Declared In
ECStream.h
– switchCamera
Attempt to switch between FRONT/REAR camera for the local stream being capturated.
- (BOOL)switchCameraReturn Value
Boolean value.
Declared In
ECStream.h
– hasAudio
Indicates if the media stream has audio tracks.
- (BOOL)hasAudioReturn Value
Boolean value.
Discussion
If you want to know if the stream was initializated requesting audio look into streamOptions dictionary.
Declared In
ECStream.h
– hasVideo
Indicates if the media stream has video tracks.
- (BOOL)hasVideoReturn Value
Boolean value.
Discussion
If you want to know if the stream was initializated requesting video look into streamOptions dictionary.
Declared In
ECStream.h
– hasData
Indicates if the stream has data activated.
- (BOOL)hasDataReturn Value
Boolean value.
Declared In
ECStream.h
– generateVideoTracks
Generates the video tracks for the stream
- (void)generateVideoTracksDeclared In
ECStream.h
– generateAudioTracks
Generates the audio tracks for the stream
- (void)generateAudioTracksDeclared In
ECStream.h
– getAttributes
Get attributes of the stream
- (NSDictionary *_Nonnull)getAttributesDeclared In
ECStream.h
– setAttributes:
Set attributes of the stream
- (void)setAttributes:(NSDictionary *_Nonnull)attributesDiscussion
Notice that this method will replace the whole dictionary.
If the stream doesn’t belong to a connected room, the attributes will be marked as dirty and they will be sent to the server once the stream gets a functional signaling channel.
If the stream is a remote stream it will not submit attributes.
Declared In
ECStream.h
– sendData:
Send data stream on channel
- (BOOL)sendData:(NSDictionary *_Nonnull)dataDiscussion
data Dictionary.
Declared In
ECStream.h
Properties
mediaStream
RTCMediaStream object that represent the stream a/v data.
@property RTCMediaStream *mediaStreamDeclared In
ECStream.h
streamAttributes
Erizo stream attributes for the stream being pubished.
@property (strong, nonatomic, readonly) NSDictionary *streamAttributesDeclared In
ECStream.h
dirtyAttributes
Indicates attributes hasn’t been sent to Erizo yet.
@property (readonly) BOOL dirtyAttributesDeclared In
ECStream.h
streamOptions
Erizo stream options.
@property (strong, nonatomic) NSMutableDictionary *streamOptionsDeclared In
ECStream.h
peerFactory
Factory instance used to access local media.
@property (strong, nonatomic) RTCPeerConnectionFactory *peerFactoryDeclared In
ECStream.h
signalingChannel
ECSignalingChannel instance assigned by ECRoom at the moment
@property (weak) ECSignalingChannel *signalingChannelDeclared In
ECStream.h
defaultVideoConstraints
Default video contraints.
@property (readonly) RTCMediaConstraints *defaultVideoConstraintsDeclared In
ECStream.h
defaultAudioConstraints
Default audio contraints.
@property (readonly) RTCMediaConstraints *defaultAudioConstraintsDeclared In
ECStream.h