SellyCloud Video
SellyCloud Video provides SDKs for Android, iOS, Web, and PC platforms that work seamlessly with SellyCloud Engine to deliver low-latency audio and video capabilities for your applications.
Overview
SellyCloud Video provides a complete streaming infrastructure that handles encoding, transcoding, and delivery of live and on-demand video content. Built for performance and reliability, it scales from small deployments to global CDN architectures.
Get Started
Choose your platform to start integrating SellyCloud Video SDK into your application. Our SDKs provide easy-to-use APIs for implementing real-time audio and video features.
iOS
Build powerful video applications for iPhone and iPad with our native iOS SDK. Written in Swift and Objective-C, it provides seamless integration with iOS frameworks.
1. Create Session
2. Set Local and Remote Canvas
3. Configure Video Parameters (Optional)
4. Start Local Preview
5. Join Channel (Start Call)
6. End Call
Android
Develop feature-rich video applications for Android devices with our native Android SDK. Built with Kotlin and Java support for maximum compatibility.
The following example is based on InteractiveLiveActivity in the Demo, showing the minimal integration process.
1. Create InteractiveRtcEngine
Create and configure the RTC engine in your Activity:
Lifecycle Note: Remember to call leaveChannel() and destroy the engine in onDestroy
2. Setup Local & Remote Video Views
Initialize local and remote rendering views:
3. Configure Video Parameters (Optional)
4. Join Channel / Start Call
5. End Call
Video API
Explore our comprehensive Video APIs for each platform. These APIs provide full control over video streaming and real-time communication features.
iOS API
Methods
SellyRTCEngine (Singleton Mode)
Global RTC engine management with singleton pattern.
| Method | Description |
|---|---|
+ (instancetype)sharedEngine |
Get the singleton instance of the RTC engine |
- (void)startUp |
Engine initialization, must be called once when app starts |
| Property | Type | Description |
|---|---|---|
userId |
NSString |
Current user ID (must be set before creating Session) |
supportSimulcast |
BOOL |
Whether to support Simulcast multi-bitrate, default YES |
SellyRTCSession (Instance Mode)
RTC session instance for individual calls, created for each call session.
Initialization Method:
| Method | Parameter | Description |
|---|---|---|
- (instancetype)initWithType: |
BOOL isP2p |
Initialize a Session instance: YES for one-to-one call, NO for multi-party conference |
Call Control:
| Method | Parameters | Description |
|---|---|---|
- (void)startWithChannelId:token: |
NSString *channelId |
Join a call or conference. channelId: channel ID for the call, token: authentication token |
- (void)end |
- | End the current call or conference and release all resources |
- (void)renewToken: |
NSString *token |
Renew authentication token when it's about to expire |
Preview Control:
| Method | Description |
|---|---|
- (void)startPreview |
Start local video preview |
- (void)stopPreview |
Stop local video preview |
Audio/Video Control:
| Method | Parameter | Description |
|---|---|---|
- (void)enableLocalVideo: |
BOOL enable |
Enable/disable local video capture and publishing, default disabled |
- (void)enableLocalAudio: |
BOOL enable |
Enable/disable local audio capture and publishing, default enabled |
- (void)switchCamera |
- | Switch between front and rear cameras |
- (void)muteRemoteAudioStream:mute: |
NSString *userId |
Mute/unmute a remote user's audio |
- (void)setAudioOutput: |
AVAudioSessionPortOverride |
Set audio output device (receiver or speaker) |
Canvas Setup:
| Method | Parameter | Description |
|---|---|---|
- (void)setLocalCanvas: |
SellyRtcVideoCanvas *canvas |
Set local video rendering canvas |
- (void)setRemoteCanvas: |
SellyRtcVideoCanvas *canvas |
Set remote video rendering canvas. Canvas contains userId to specify remote user |
Advanced Features:
| Method | Parameters | Description |
|---|---|---|
- (void)sendMessage:completion: |
NSString *message |
Send custom signaling message within the session |
- (void)startScreenCapture |
- | Start screen sharing (requires iOS screen recording support) |
- (void)pushExternalVideoFrame: |
CVPixelBufferRef pixelBuffer |
Push external video frames, typically for beauty filter processing |
Properties:
| Property | Type | Description |
|---|---|---|
delegate |
id<SellyRTCSessionDelegate> |
Event callback delegate |
videoConfig |
SellyRTCVideoConfiguration |
Video encoding parameter configuration |
connectionState |
SellyRTCConnectState |
Current call connection state (read-only) |
Callbacks
Implement the SellyRTCSessionDelegate protocol to receive call event callbacks.
Connection Status Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (void)rtcSession:didChangeState: |
SellyRTCSession *session |
Connection state change callback |
- (void)rtcSession:connectionChangedToState:reason: |
SellyRTCSession *session |
Detailed room connection state and reason |
User Event Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (void)rtcSession:didJoinedOfUid: |
SellyRTCSession *session |
Remote user joined the call |
- (void)rtcSession:didOfflineOfUid:reason: |
SellyRTCSession *session |
Remote user left the call |
- (void)rtcSession:didAudioMuted:byUid: |
SellyRTCSession *session |
Remote user's audio mute state changed |
- (void)rtcSession:didVideoMuted:byUid: |
SellyRTCSession *session |
Remote user's video mute state changed |
Data Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (void)rtcSession:didReceivedMessage:fromUid: |
SellyRTCSession *session |
Received custom signaling message |
- (void)rtcSession:reportRtcStats: |
SellyRTCSession *session |
RTC call quality statistics report (called every 2 seconds) |
Video Processing Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (CVPixelBufferRef)rtcSession:didCaptureVideoPixelBuffer: |
SellyRTCSession *session |
Captured original video frame, can process and return new frame |
Token Management Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (void)rtcSessionTokenPrivilegeWillExpire: |
SellyRTCSession *session |
Token is about to expire (30 seconds before expiration), need to renew token |
- (void)rtcSessionRequestToken: |
SellyRTCSession *session |
Token has expired, need to provide new token immediately |
Screen Sharing Callbacks:
| Callback | Parameters | Description |
|---|---|---|
- (void)rtcSession:screenCaptureStateChanged: |
SellyRTCSession *session |
Screen sharing state changed |
Call Statistics
SellyRtcStats object contains comprehensive RTC call quality statistics.
Basic Information:
| Property | Type | Description |
|---|---|---|
duration |
NSInteger |
Call duration in seconds |
txKBitRate |
NSInteger |
Total send bitrate in Kbps |
rxKBitRate |
NSInteger |
Total receive bitrate in Kbps |
rtt |
NSInteger |
Round-trip time in milliseconds |
audioProtocol |
NSString |
Audio protocol used (e.g., opus) |
videoProtocol |
NSString |
Video protocol used (e.g., H264, VP8) |
Video Send Information:
| Property | Type | Description |
|---|---|---|
txVideoWidth |
NSInteger |
Send video width |
txVideoHeight |
NSInteger |
Send video height |
txVideoFps |
NSInteger |
Send video frame rate |
Video Receive Information:
| Property | Type | Description |
|---|---|---|
rxVideoWidth |
NSInteger |
Receive video width |
rxVideoHeight |
NSInteger |
Receive video height |
rxVideoFps |
NSInteger |
Receive video frame rate |
Audio Bitrate Statistics:
| Property | Type | Description |
|---|---|---|
txAudioKBitRate |
NSInteger |
Audio send bitrate in Kbps |
rxAudioKBitRate |
NSInteger |
Audio receive bitrate in Kbps |
Video Bitrate Statistics:
| Property | Type | Description |
|---|---|---|
txVideoKBitRate |
NSInteger |
Video send bitrate in Kbps |
rxVideoKBitRate |
NSInteger |
Video receive bitrate in Kbps |
Cumulative Byte Statistics:
| Property | Type | Description |
|---|---|---|
txBytes |
NSInteger |
Total bytes sent |
rxBytes |
NSInteger |
Total bytes received |
txAudioBytes |
NSInteger |
Audio bytes sent |
rxAudioBytes |
NSInteger |
Audio bytes received |
txVideoBytes |
NSInteger |
Video bytes sent |
rxVideoBytes |
NSInteger |
Video bytes received |
Enumerations
SellyRTCConnectState - Connection State:
| Value | Description |
|---|---|
SellyRTCConnectStateDisconnected |
Disconnected state |
SellyRTCConnectStateConnecting |
Connecting |
SellyRTCConnectStateConnected |
Connected successfully |
SellyRTCConnectStateReconnecting |
Reconnecting |
SellyRTCConnectStateFailed |
Connection failed |
SellyRoomConnectionState - Room Connection State:
| Value | Description |
|---|---|
SellyRoomConnectionStateIdle |
Idle state, not yet joined |
SellyRoomConnectionStateConnecting |
Joining room |
SellyRoomConnectionStateConnected |
Joined successfully |
SellyRoomConnectionStateDisconnected |
Disconnected from room |
SellyVideoCodecType - Video Codec Type:
| Value | Description |
|---|---|
SellyVideoCodecTypeH264 |
H.264 codec |
SellyVideoCodecTypeVP8 |
VP8 codec |
SellyRTCVideoResolution - Video Resolution Presets:
| Value | Resolution |
|---|---|
SellyRTCVideoResolution120x120 |
120Ã120 |
SellyRTCVideoResolution180x180 |
180Ã180 |
SellyRTCVideoResolution240x240 |
240Ã240 |
SellyRTCVideoResolution480x480 |
480Ã480 |
SellyRTCVideoResolution640x480 |
640Ã480 (VGA) |
SellyRTCVideoResolution960x720 |
960Ã720 |
SellyRTCVideoResolution1280x720 |
1280Ã720 (720p) |
SellyRTCVideoResolution1920x1080 |
1920Ã1080 (1080p) |
SellyScreenShareState - Screen Sharing State:
| Value | Description |
|---|---|
SellyScreenShareStateIdle |
Not sharing |
SellyScreenShareStateStart |
Screen sharing started |
SellyScreenShareStateStop |
Screen sharing stopped |
Android API
1. Methods
RTC call core engine - InteractiveRtcEngine
Class Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
create(config) |
config: InteractiveRtcEngineConfig |
InteractiveRtcEngine |
Create RTC engine |
destroy(engine) |
engine: InteractiveRtcEngine? |
- | Destroy RTC engine |
Channel Management
| Method | Parameters | Description |
|---|---|---|
joinChannel(...) |
See joinChannel Parameters table below | Join channel |
leaveChannel() |
- | Leave channel |
renewToken(token) |
token: String |
Update Token |
joinChannel Parameters:
| Parameter | Type | Description |
|---|---|---|
token |
String? |
Authentication Token |
callId |
String |
Channel ID |
userId |
String |
User ID |
options |
InteractiveChannelMediaOptions |
Channel options |
tokenSecret |
String? |
Token secret (for automatic renewal) |
tokenExpiresAtSec |
Long? |
Token expiration timestamp |
tokenTtlSeconds |
Long |
Token validity period (seconds) |
Video Control
| Method | Parameters | Description |
|---|---|---|
setupLocalVideo(canvas) |
canvas: InteractiveVideoCanvas |
Set local video canvas |
setupRemoteVideo(canvas) |
canvas: InteractiveVideoCanvas |
Set remote video canvas |
clearRemoteVideo(userId) |
userId: String |
Clear remote video canvas |
enableLocalVideo(enabled) |
enabled: Boolean |
Enable/disable local video |
switchCamera() |
- | Switch front/rear camera |
Audio Control
| Method | Parameters | Description |
|---|---|---|
enableLocalAudio(enabled) |
enabled: Boolean |
Enable/disable local audio |
setDefaultAudioRoutetoSpeakerphone(speakerOn) |
speakerOn: Boolean |
Set audio output route |
muteRemoteAudioStream(userId, muted) |
userId: String, muted: Boolean |
Mute/unmute remote user |
muteRemoteVideoStream(userId, muted) |
userId: String, muted: Boolean |
Disable/enable remote video |
Role Settings
| Method | Parameters | Description |
|---|---|---|
setClientRole(role) |
role: ClientRole |
Set user role |
Encoding Configuration
| Method | Parameters | Description |
|---|---|---|
setVideoEncoderConfiguration(config) |
config: InteractiveVideoEncoderConfig |
Set video encoding parameters |
Message Sending
| Method | Parameters | Description |
|---|---|---|
sendMessage(message, callback) |
message: String, callback: (Error?) -> Unit |
Send custom message |
Screen Sharing
| Method | Parameters | Returns | Description |
|---|---|---|---|
startScreenShare(resultCode, data, width, height, fps) |
resultCode: Int, data: Intent, width: Int, height: Int, fps: Int |
Boolean |
Start screen sharing |
stopScreenShare() |
- | Boolean |
Stop screen sharing |
Beauty Filter/Video Processing
| Method | Parameters | Description |
|---|---|---|
setCaptureVideoFrameInterceptor(interceptor) |
interceptor: (VideoFrame) -> VideoFrame? |
Set video frame interceptor |
Event Callbacks
| Method | Parameters | Description |
|---|---|---|
setEventHandler(handler) |
handler: InteractiveRtcEngineEventHandler |
Set event callback |
Configuration Objects
InteractiveRtcEngineConfig: RTC engine initialization configuration
| Property | Type | Description |
|---|---|---|
context |
Context |
Application context |
appId |
String |
Application ID |
defaultToken |
String? |
Default Token |
InteractiveVideoEncoderConfig: Video encoding parameter configuration
| Property | Type | Default | Description |
|---|---|---|---|
width |
Int |
640 | Video width |
height |
Int |
480 | Video height |
fps |
Int |
20 | Frame rate |
minBitrateKbps |
Int |
150 | Minimum bitrate (Kbps) |
maxBitrateKbps |
Int |
850 | Maximum bitrate (Kbps) |
InteractiveVideoCanvas: Video rendering canvas configuration
| Property | Type | Description |
|---|---|---|
renderer |
SurfaceViewRenderer |
Video rendering view |
userId |
String |
User ID |
InteractiveChannelMediaOptions: Channel media options configuration
| Property | Type | Description |
|---|---|---|
callType |
CallType |
Call type |