iOS SDK API Reference
|
Alternative class as MediaConnection. More...
#import <SKWMediaConnection.h>
Instance Methods | |
(void) | - answer |
When receiving a call event on a peer, you can call .answer on the media connection provided by the callback to accept the call. More... | |
(void) | - answer: |
When receiving a call event on a peer, you can call .answer on the media connection provided by the callback to accept the call. More... | |
(void) | - answer:options: |
When receiving a call event on a peer, you can call .answer on the media connection provided by the callback to accept the call with options. More... | |
(void) | - close |
Closes the media connection. More... | |
(void) | - close: |
Closes the media connection with the forceClose option. More... | |
(void) | - on:callback: |
Set callbacks for media connection events. More... | |
(void) | - replaceStream: |
Change the MediaStream that is being sent. More... | |
(void) | - getStats: |
Get statistics of the connection. More... | |
Properties | |
NSString *__nullable | connectionId |
Connection ID. | |
NSString *__nullable | metadata |
Any type of metadata associated with the connection, passed in by whoever initiated the connection. | |
BOOL | isOpen |
This is true if the connection is open and ready for read/write. | |
NSString *__nullable | peer |
The ID of the peer on the other end of this connection. | |
NSString *__nullable | type |
For type of connection. | |
NSString *__nullable | label |
The optional label passed in or assigned by PeerJS when the connection was initiated. | |
BOOL | reliable |
Whether the underlying data channels are reliable; defined when the connection was initiated. | |
SKWSerializationEnum | serialization |
The serialization format of the data sent over the connection. More... | |
SKWPeer *__nullable | provider |
Provider PeerObjC object. | |
Alternative class as MediaConnection.
- (void) answer |
- (void) answer: | (SKWMediaStream *__nullable) | stream |
When receiving a call event on a peer, you can call .answer on the media connection provided by the callback to accept the call.
stream | Video stream |
- (void) answer: | (SKWMediaStream *__nullable) | stream | |
options: | (SKWAnswerOption *__nullable) | options | |
When receiving a call event on a peer, you can call .answer on the media connection provided by the callback to accept the call with options.
stream | Video stream |
options | Answer Options |
- (void) close |
Closes the media connection.
Run the forceClose option as NO. May be changed to YES from a future version.
- (void) close: | (BOOL) | forceClose |
Closes the media connection with the forceClose option.
forceClose | Set to YES and the connection on remote peer will close immediately. When set to NO, the connection on remote peer will close after the end of the ICE reconnect by the browser. |
- (void) getStats: | (SKWConnectionGetStatsCallback __nullable) | callback |
Get statistics of the connection.
callback | Callback block literal |
- (void) on: | (SKWMediaConnectionEventEnum) | event | |
callback: | (SKWMediaConnectionEventCallback __nullable) | callback | |
Set callbacks for media connection events.
(Block Literal Syntax)
event | Event type |
callback | Callback block literal |
- (void) replaceStream: | (SKWMediaStream *__nullable) | newStream |
Change the MediaStream that is being sent.
For example, you can use it to change the camera device or the image quality.
Note: It is not possible to change the state of a MediaStream from not sending to sending.You cannot change the state of MediaStream from not sending to sending and vice versa.
It is also not possible to interchange "MediaStream with either video or audio only" and "MediaStream with both video and audio".
newStream |
|
readnonatomicassigninherited |
The serialization format of the data sent over the connection.
Can be binary (default), binary-utf8, json, or none.