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 *)audioConstraints
Parameters
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 *)audioConstraints
Parameters
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 *)attributes
Parameters
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)initLocalStream
Return 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 *)signalingChannel
Parameters
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)switchCamera
Return Value
Boolean value.
Declared In
ECStream.h
– hasAudio
Indicates if the media stream has audio tracks.
- (BOOL)hasAudio
Return 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)hasVideo
Return 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)hasData
Return Value
Boolean value.
Declared In
ECStream.h
– generateVideoTracks
Generates the video tracks for the stream
- (void)generateVideoTracks
Declared In
ECStream.h
– generateAudioTracks
Generates the audio tracks for the stream
- (void)generateAudioTracks
Declared In
ECStream.h
– getAttributes
Get attributes of the stream
- (NSDictionary *_Nonnull)getAttributes
Declared In
ECStream.h
– setAttributes:
Set attributes of the stream
- (void)setAttributes:(NSDictionary *_Nonnull)attributes
Discussion
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)data
Discussion
data Dictionary.
Declared In
ECStream.h
Properties
mediaStream
RTCMediaStream object that represent the stream a/v data.
@property RTCMediaStream *mediaStream
Declared In
ECStream.h
streamAttributes
Erizo stream attributes for the stream being pubished.
@property (strong, nonatomic, readonly) NSDictionary *streamAttributes
Declared In
ECStream.h
dirtyAttributes
Indicates attributes hasn’t been sent to Erizo yet.
@property (readonly) BOOL dirtyAttributes
Declared In
ECStream.h
streamOptions
Erizo stream options.
@property (strong, nonatomic) NSMutableDictionary *streamOptions
Declared In
ECStream.h
peerFactory
Factory instance used to access local media.
@property (strong, nonatomic) RTCPeerConnectionFactory *peerFactory
Declared In
ECStream.h
signalingChannel
ECSignalingChannel instance assigned by ECRoom at the moment
@property (weak) ECSignalingChannel *signalingChannel
Declared In
ECStream.h
defaultVideoConstraints
Default video contraints.
@property (readonly) RTCMediaConstraints *defaultVideoConstraints
Declared In
ECStream.h
defaultAudioConstraints
Default audio contraints.
@property (readonly) RTCMediaConstraints *defaultAudioConstraints
Declared In
ECStream.h