Swift
Empower your mobile applications with seamless real-time communication and media functionalities using the powerful Sariska Media Swift APIs. Integrate features like audio/video calling, live streaming, cloud recording, transcriptions, and language translation effortlessly into your iOS, macOS, watchOS, and tvOS apps.
Installation
Step 1 : Install Sariska Media Transport Client
With CocoaPods
pod 'sariska-media-transport', :git => 'https://github.com/SariskaIO/sariska-ios-sdk-releases.git', tag:'1.1.5', :branch => 'master'Step 2 : Initialize SDK
// Import the Sariska framework to access its classes
import sariska
// Perform initial setup tasks
SariskaMediaTransport.initializeSdk();Step 3 : Establish a WebSocket Connection
Media Services utilizes WebSockets to establish a continuous, two-way communication channel between your application and the server. This persistent connection offers significant advantages over traditional HTTP requests, particularly in terms of responsiveness.
Step 4 : Initiate a Conference
Create a Jitsi-powered conference for real-time audio and video.
Step 5 : Capture Local Stream
Media Stream
A MediaStream is a collection of audio or video tracks, represented by MediaStreamTrack objects.
Each MediaStreamTrack can have multiple channels (e.g., left and right channels in a stereo audio track).
Capture Local Tracks
Define options:
Specify desired devices ("audio", "video", or "desktop").
Set preferred video resolution.
Optionally configure specific devices, frame rates, screen sharing options, and facing mode.
Step 6 : Play Local Stream
Step 7 : Handle User Joined Event
This event is triggered when a new user joins the conference. Moderators have exclusive control over meetings and can manage participants. To assign a moderator, set the moderator value to true when generating the token.
Step 8 : Publish Streams
Make audio and video streams visible to others in the conference by publishing them using the following code:
Step 9 : Play Remote Peers Streams
Analytics
Sariska-media-transport offers pre-configured events to help you track and analyze user interactions, media usage, and overall performance. This data can be used to enhance your product, improve user experience, and make informed decisions.
Available Events
Here are some of the key events you can track:
User Actions:
User joined
User left
Media Usage:
Conference duration
Camera duration
Audio track duration
Video track duration
Recording:
Recording started
Recording stopped
Local recording started
Local recording stopped
Transcription:
Transcription started
Transcription stopped
Performance:
Speaker stats
Connection stats
Performance stats
Add Event Listener to Track Events
Features
Sariska offers powerful features to enhance your application's capabilities. Find your desired feature using the search bar or explore below!
Active/Dominant Speaker
Identify the main speaker: Easily detect the active or dominant speaker in a conference. Choose to stream only their video for improved resolution and reduced bandwidth usage. Ideal for one-way streaming scenarios like virtual concerts.
Last N Speakers
Dynamically showcase recent speakers: Focus on the active conversation by displaying video only for the last N participants who spoke. This automatically adjusts based on speech activity, offering a more efficient and relevant view.
Participant Information
Set local participant properties: Define additional information about participants beyond the default settings. This can include screen-sharing status, custom roles, or any other relevant attributes.
Participant Count
Get the total number of participants: Retrieve the complete participant count, including both visible and hidden members.
Participant Lists
Access all participants: Obtain a list of all participants, including their IDs and detailed information.
Pinning Participants
Pin a single participant: Give a participant higher video quality (if simulcast is enabled).
Pin multiple participants: Give multiple participants higher video quality.
Access Local User Details
Retrieve information about the local user directly from the conference object.
Set Meeting Subject
Set the subject of the meeting.
Manage Tracks
Get all remote tracks: Retrieve a list of all remote tracks (audio and video) in the conference.
Get all local tracks: Retrieve a list of all local tracks (audio and video)
Kick Participants
Listen for participant kick events
Kick a participant
Kick a moderator
Manage Owner Roles
The room creator has a moderator role, while other users have a participatory role.
Grant owner rights
Listen for role changes
Revoke owner rights
Change Display Names
Setting a new display name
Listen for display name changes
Lock/Unlock Room
Lock room: Moderators can restrict access to the room with a password.
Unlock room: Removes any existing password restriction.
Subtitles
Request subtitles: Enable subtitles for spoken content.
Request language translation: Translate subtitles into a specific language.
af
Afrikaans
ar
Arabic
bg
Bulgarian
ca
Catalan
cs
Czech
da
Danish
de
German
el
Greek
en
English
enGB
English (United Kingdom)
eo
Esperanto
es
Spanish
esUS
Spanish (Latin America)
et
Estonian
eu
Basque
fi
Finnish
fr
French
frCA
French (Canadian)
he
Hebrew
hi
Hindi
hr
Croatian
hu
Hungarian
hy
Armenian
id
Indonesian
it
Italian
ja
Japanese
kab
Kabyle
ko
Korean
lt
Lithuanian
ml
Malayalam
lv
Latvian
nl
Dutch
oc
Occitan
fa
Persian
pl
Polish
pt
Portuguese
ptBR
Portuguese (Brazil)
ru
Russian
ro
Romanian
sc
Sardinian
sk
Slovak
sl
Slovenian
sr
Serbian
sq
Albanian
sv
Swedish
te
Telugu
th
Thai
tr
Turkish
uk
Ukrainian
vi
Vietnamese
zhCN
Chinese (China)
zhTW
Chinese (Taiwan)
mr
Marathi
Receive subtitles: Listen for incoming subtitles.
Stop subtitles: Disable subtitles.
Screen Share
Each participant can contribute two types of data to a meeting: audio and video. Screen sharing counts as a video track. If you want to share your screen while also showing your own video (like when presenting), you need to enable "Presenter mode". This mode hides the gallery of other participants' videos and gives you more control over the meeting layout.
Start screen share: Share your screen with other participants.
Messages
Sariska offers robust messaging capabilities for both private and group communication scenarios.
Send a group message to all participants
Send a private message to a specific participant
Listen for incoming messages
Transcription
Start Transcription: Initiate transcription for the ongoing conference.
Stop Transcription: Stop transcription and get a download link for the transcript.
Mute/Unmute Participants
Mute Remote Participant
Mute/Unmute Local Participant
Connection Quality
Local Connection Statistics Received
Remote Connection Statistics Received
Internet Connectivity Status
The SDK features intelligent auto-join/leave functionality based on internet connectivity status. This helps optimize network resources and improve user experience.
Peer-to-Peer Mode
Designed for efficient communication between two participants.
Start Peer-to-Peer Mode
Sariska automatically activates Peer-to-Peer mode when your conference has exactly two participants. This mode bypasses the central server and directly connects participants, maximizing bandwidth efficiency and reducing latency. However, even with more than two participants, you can forcefully start Peer-to-Peer mode.
Stop Peer-to-Peer Mode
If you need to revert to server-mediated communication, you can easily stop Peer-to-Peer mode.
CallStats Integration
Monitor your WebRTC application performance using CallStats (or build your own). See the "RTC Stats" section for details.
Join Muted/Silent
Join conferences with audio and video already muted, or in a silent mode where no audio is transmitted or received. This ensures a seamless experience and respects participant preferences.
Join with Muted Audio and Video
Join in Silent Mode
Live Stream
Broadcast your conference to multiple platforms simultaneously. Embed live streams directly into your app or website using various formats.
Stream to YouTube
Stream to Facebook
Stream to Twitch
Stream to any RTMP Server
Listen for RECORDER_STATE_CHANGED event to track streaming status
Stop Live Stream
Cloud Recording
Store your recordings and transcriptions in various cloud storage services.
PSTN
Dial-in(PSTN)
Dial-out(PSTN)
Lobby/Waiting Room
SIP Video Gateway
One-to-One Calling
This allows synchronous phone calls, similar to WhatsApp, even if the receiver's app is closed or in the background.
Initiating Calls:
Make a call even if the callee's app is closed or in the background.
Play a busy tone if the callee is on another call or disconnects your call.
Play ringtone/ringback/DTMF tones.
Step 1 : Caller Initiates Call
HTTP Call to Sariska Server
{API Method}
Push Notification to callee using Firebase or APNS
This notifies the receiver even if their app is closed or in the background.
Step 2 : Callee Responds to Call
Reads Push Notification
Processes the notification even if the app is closed or in the background.
HTTP Call to Update Status
{API Method}
No need to join conference via SDK
Status update through the HTTP call suffices.
Step 3 : Caller Receives Response
Listens for USER_STATUS_CHANGED event
Step 4 : After Connection Established
The call proceeds like a normal conference call.
Last updated