iOS SDK API Reference

Instance Methods | Properties | List of all members
SKWMediaStream Class Reference

Media stream. More...

#import <SKWMediaStream.h>

Inheritance diagram for SKWMediaStream:

Instance Methods

(void) - close
 Close all tracks.
 
(NSUInteger) - getVideoTracks
 Get video track count. More...
 
(void) - setEnableVideoTrack:enable:
 Set video track enabling state. More...
 
(BOOL) - getEnableVideoTrack:
 Get video track enabling state. More...
 
(NSUInteger) - getAudioTracks
 Get audio track count. More...
 
(void) - setEnableAudioTrack:enable:
 Set audio track enabling state. More...
 
(BOOL) - getEnableAudioTrack:
 Get audio track enabling state. More...
 
(BOOL) - setCameraPosition:
 Set camera position. More...
 
(SKWCameraPositionEnum- getCameraPosition
 Get camera position. More...
 
(BOOL) - switchCamera
 Switch camera. More...
 
(void) - addVideoRenderer:track:
 
(void) - removeVideoRenderer:track:
 

Properties

NSString *__nullable label
 media stream label
 
NSString *__nullable peerId
 remote media stream peer id
 

Detailed Description

Media stream.

Method Documentation

◆ addVideoRenderer:track:

- (void) addVideoRenderer: (SKWVideo *__nonnull)  renderer
track: (NSUInteger)  trackNo 
SKWVideo* video;
[stream addVideoRenderer:video track:0];
Parameters
rendererVideo Renderer
trackNoTrack number. (0-)

◆ getAudioTracks

- (NSUInteger) getAudioTracks

Get audio track count.

NSUInteger audios = [stream getVideoTracks];
Returns
Count of audio track.

◆ getCameraPosition

- (SKWCameraPositionEnum) getCameraPosition

Get camera position.

switch (pos) {
// front camera
break;
// back camera
break;
// unknown
break;
}
Returns
Current camera position.

◆ getEnableAudioTrack:

- (BOOL) getEnableAudioTrack: (NSUInteger)  pos

Get audio track enabling state.

BOOL enable = [stream getEnableAudioTrack:0];
if (enable) {
// playing
} else {
// stopped
}
Parameters
posTrack number.
Returns
Enabling state.

◆ getEnableVideoTrack:

- (BOOL) getEnableVideoTrack: (NSUInteger)  pos

Get video track enabling state.

BOOL enable = [stream getEnableVideoTrack:0];
if (enable) {
// playing
} else {
// stopped
}
Parameters
posTrack number.
Returns
Enabling state.

◆ getVideoTracks

- (NSUInteger) getVideoTracks

Get video track count.

NSUInteger videos = [stream getVideoTracks];
Returns
Count of video track.

◆ removeVideoRenderer:track:

- (void) removeVideoRenderer: (SKWVideo *__nonnull)  renderer
track: (NSUInteger)  trackNo 
SKWVideo* video;
[stream removeVideoRenderer:video track:0];
Parameters
renderer
trackNoTrack number. (0-)

◆ setCameraPosition:

- (BOOL) setCameraPosition: (SKWCameraPositionEnum pos

Set camera position.

BOOL result = [stream setCameraPosition:SKW_CAMERA_POSITION_FRONT];
if (result) {
// successful.
} else {
// failure.
}
Parameters
posCamera position.
Returns
Method result.

◆ setEnableAudioTrack:enable:

- (void) setEnableAudioTrack: (NSUInteger)  pos
enable: (BOOL)  enable 

Set audio track enabling state.

[stream setEnableAudioTrack:0 enable:YES];
Parameters
posTrack number.
enableEnabling state.

◆ setEnableVideoTrack:enable:

- (void) setEnableVideoTrack: (NSUInteger)  pos
enable: (BOOL)  enable 

Set video track enabling state.

[stream setEnableVideoTrack:0 enable:YES];
Parameters
posTrack number.
enableEnabling state.

◆ switchCamera

- (BOOL) switchCamera

Switch camera.

BOOL result = [stream switchCamera];
if (result) {
// successful.
} else {
// failure.
}
Returns
Method result.
SKW_CAMERA_POSITION_UNSPECIFIED
@ SKW_CAMERA_POSITION_UNSPECIFIED
Unspecified.
Definition: SKWMediaConstraints.h:20
-[SKWMediaStream addVideoRenderer:track:]
void addVideoRenderer:track:(SKWVideo *__nonnull renderer,[track] NSUInteger trackNo)
-[SKWMediaStream setEnableAudioTrack:enable:]
void setEnableAudioTrack:enable:(NSUInteger pos,[enable] BOOL enable)
Set audio track enabling state.
SKWMediaStream
Media stream.
Definition: SKWMediaStream.h:18
-[SKWMediaStream getEnableVideoTrack:]
BOOL getEnableVideoTrack:(NSUInteger pos)
Get video track enabling state.
-[SKWMediaStream getEnableAudioTrack:]
BOOL getEnableAudioTrack:(NSUInteger pos)
Get audio track enabling state.
SKWVideo
Video view.
Definition: SKWVideo.h:47
-[SKWMediaStream switchCamera]
BOOL switchCamera()
Switch camera.
SKW_CAMERA_POSITION_FRONT
@ SKW_CAMERA_POSITION_FRONT
Front camera.
Definition: SKWMediaConstraints.h:28
-[SKWMediaStream getCameraPosition]
SKWCameraPositionEnum getCameraPosition()
Get camera position.
-[SKWMediaStream getVideoTracks]
NSUInteger getVideoTracks()
Get video track count.
-[SKWMediaStream setCameraPosition:]
BOOL setCameraPosition:(SKWCameraPositionEnum pos)
Set camera position.
SKW_CAMERA_POSITION_BACK
@ SKW_CAMERA_POSITION_BACK
Back camera.
Definition: SKWMediaConstraints.h:24
SKWCameraPositionEnum
SKWCameraPositionEnum
Device camera position.
Definition: SKWMediaConstraints.h:15
-[SKWMediaStream setEnableVideoTrack:enable:]
void setEnableVideoTrack:enable:(NSUInteger pos,[enable] BOOL enable)
Set video track enabling state.
-[SKWMediaStream removeVideoRenderer:track:]
void removeVideoRenderer:track:(SKWVideo *__nonnull renderer,[track] NSUInteger trackNo)