Java
Sariska Media provides powerful Java API's for developing real-time applications.
You can integrate audio/video, live streaming cloud recording, transcriptions, language translation and many other services on the fly.
This API documentation describes all possible features supported by sariska-media-transport which possibly covers any of your use cases.
Installation
Use pre-built SDK artifacts/binaries
In your project, add the Maven repository https://github.com/SariskaIO/sariska-maven-repository/raw/master/releases and the dependency io.sariska:sariska-media-transport into your build.gradle files.
The repository typically goes into the build.gradle file in the root of your project:
allprojects {
repositories {
maven {
url "https://github.com/SariskaIO/sariska-maven-repository/raw/master/releases"
}
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}In recent versions of Android Studios, allprojects{} might not be found in build.gradle. In that case, the repository goes into the settings.gradle file in the root of your project:
Maven
Dependency definitions belong in the individual module build.gradle files:
Setting up
1. Initialize SDK
After you install the SDK, perform initial setup tasks by running initializeSdk().
2. Create Connection
WebSockets are ideal to keep a single, persistent session. Unlike HTTPS, WebSocket requests are updated almost immediately. To start using the media services, the primary step is to create a Media WebSocket connection.
3. Create Conference
Once you have your connection established, the next step is to create a conference. Sariska is backed by the Jitsi architecture.
4. Capture local streams
A MediaStream consists of zero or more MediaStreamTrack objects, representing various audio or video tracks.
Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track. Here we mostly talk about track.
5. Play local stream
This will be your most basic conference call. However, we recommend following up with the two further steps to add customized features to enhance your experience.
Note: You don't any audio element to play sound as it plays in conjunction with video stream.
6. User Joined
The moderator of the meeting controls and gatekeeps the participants. The moderator has exclusive control of the meeting.
If you wish to have a moderator, pass the moderator value as true while generating your token. Moderator has the following permissions:
Ability to add a password to a room
Ability to grant the moderator role to non-moderators
Ability to kick non-moderators or other moderators
Ability to mute participates
Ability to make everyone see the moderator video (Everyone follows me)
Ability to make participants join muted (Everyone starts muted)
Ability to make participants join without video (Everyone starts hidden)
Ability to enable/disable the lobby room
Ability to approve join/knocking requests (when the lobby is enabled)
When the moderator leaves, a new one is selected automatically
7. Publish your stream to other peers
Use the following code to now publish your call.
8. Playing remote peers streams
That's it you are done with a basic conference call, Follow the guide below for more features.
Analytics
Sariska-media-transport comes with pre-configured top events used to help improvise your product and overall consumer experience.
Few popular events:
User left
User joined
Conference duration
Camera duration
Audio track duration
Video track duration
Recording started
Recording stopped
Transcription started
Transcription stopped
Local Recording started
Local Recording stopped
Speaker Stats
We will be updating the list of features soon.
Features
Active/Dominant Speaker
You can easily detect the active or the dominant speaker. You could choose to stream only their video, thereby saving on the costs and better resolution to others. This is could be a use case for one-way streaming; such as virtual concerts.
Last N Speakers
The idea is that we select a subset of N participants, whose video to show, and we stop the video from others. We dynamically and automatically adjust the set of participants that we show according to who speaks – effectively we only show video for the last N people to have spoken.
Participant information
Set Local Participant Property
Get participant count
Note: Hidden participants are generally bots join the conference along with actual participants. For example: recorder, transcriber, pricing agent.
Get all participants in conference
Get all participants in conference without hidden participants
Pin/Select participant
Select/Pin Multiple Participants
Access local user details directly from conference
Set meeting subject
Remote/Local tracks
Get all remote tracks
Get all local tracks
Kick Out
Grant/Revoke Owner
Grant Owner
Except for the room creator, the rest of the users have a participatory role. You can grant them owner rights with the following code.
Revoke Owner
To revoke owner rights from a participant, use the following code.
Change Display Name
Lock/Unlock Room
Lock room
A moderator can lock a room with a password. Use the code as follows.
Unlock room
Subtitles
Screen Sharing
Start Screen Sharing
A participant supports 2 tracks at a type: audio and video. Screen sharing(desktop) is also a type of video track. If you need screen sharing along with the speaker video you need to have Presenter mode enabled.
Send message
Transcription
Start Transcription
Stop Transcription
Mute/Unmute Participants
Mute/Unmute Local participant
Mute Remote participant
The moderator can mute any remote participant.
Connection Quality
Internet Connectivity Status
SDK is already configured to auto-join/leave when the internet connection fluctuates.
Peer-to-Peer mode
Start peer-to-peer mode
Sariska automatically switches to peer peer-to-peer mode if participants in the conference exactly 2. You can, however, still, you can forcefully switch to peer-to-peer mode.
Note: Conferences started on peer-to-peer mode will not be charged until the turn server is not used.
Stop peer-to-peer mode
CallStats integration
To monitor your WebRTC application, simply integrate the call stats or build your own by checking out the RTC Stats section.
Join Muted/Silent
Join Silent( no audio will be sent/receive)
join conference with silent mode no audio sent/receive
Join Muted
To start a conference with already muted options.
Live Streaming
Stream to YouTube
You can get youtube stream key manually by login to your youtube account or use google OAuth API
Stream to Facebook
You can get facebook streamId manually by login to your facebook account or use Facebook OAuth API.
Stream to Twitch
Stream to any RTMP server
Listen for RECORDER_STATE_CHANGED event to know live streaming status
Stop Live Streaming
Cloud Recording
Stop Cloud Recording
PSTN
Dial-in(PSTN)
Dial-out(PSTN)
Lobby/Waiting room
To enable the feature for waiting room/lobby checkout APIs below
Video SIP Calling
One-to-one calling
One-to-one calling is more of the synchronous way of calling where you deal with things like
Calling someone even if his app is closed or background
Play a busy tone if a user is busy on another call or disconnected your call
Play ringtone/ringback/dtmftone
This is similar to how WhatsApp works.
Make an HTTP call to the Sariska server
Send push notifications to callee using your Firebase or APNS account
Callee now reads the push notification using ConnectionService or CallKit even if the app is closed or in the background
Callee can update his status back to the caller just by making an updated HTTP Call, no needs to join the conference via SDK
Since, the Caller has already joined the conference using SDK he can easily get the status just by listening USER_STATUS_CHANGED event
After the callee has joined the conference rest of the steps are the same as the normal conference call
Calendar Sync
Now you can programmatically start scheduling a meeting with google/microsoft calendar.
Slack integration
This integration adds the /sariska slash command for your team so that you can start a video conference in your channel, making it easy for everyone to just jump on the call. The slash command, /sariska, will drop a conference link in the channel for all to join.
Mentioning one or more teammates, after /sariska, will send personalized invites to each user mentioned. Check out how it is integrated here.
RTC Stats
Low-level logging on peer connection API calls and periodic getStats calls for analytics/debugging purposes. Make sure you have passed RTCstats WebSocket URL while initializing the conference. Check out how to configure RTCStats WebSocket Server here.
Logging
Last updated