Skip to content

Commit

Permalink
Pull request #18: Aarnautovic WEBRTC-1 Smaller fixes
Browse files Browse the repository at this point in the history
Merge in WEBRTC/infobip-rtc-android from aarnautovic-WEBRTC-1-Smaller-fixes to master

Squashed commit of the following:

commit 2ee9234960070cc99861d0871f1e04601aebc61a
Author: Adnan Arnautovic <adnan.arnautovic@infobip.com>
Date:   Wed Mar 31 17:10:59 2021 +0200

    Fixes after merge

commit 3180340b3e548b2a0aaa9b77742768a78f8e647c
Author: Adnan Arnautovic <adnan.arnautovic@infobip.com>
Date:   Wed Mar 31 16:57:48 2021 +0200

    Reverted commit

commit f798e8b9ef5c6788b9ede0b693bc832cc977ca02
Author: Adnan Arnautovic <adnan.arnautovic@infobip.com>
Date:   Fri Mar 26 19:05:17 2021 +0100

    Manual changes

commit 90f1614ad0a5dfd414d22bd502aa5675217ce977
Author: Adnan Arnautovic <adnan.arnautovic@infobip.com>
Date:   Fri Mar 26 18:52:43 2021 +0100

    JetBrains code cleaning
  • Loading branch information
Adnan Arnautovic authored and Adnan Arnautovic committed Mar 31, 2021
1 parent 5a8c3ab commit faf4385
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
### Introduction
Infobip RTC is an Android SDK which enables you to take advantage of Infobip platform since it gives you the ability to enrich your Android applications with real-time communications in minimum time, allowing you to focus on your application's user experience and business logic. We currently support audio and video calls between two web or app users, and phone calls between web or app user and an actual phone device.
Infobip RTC is an Android SDK which enables you to take advantage of Infobip platform since it gives you the ability to enrich your Android applications with real-time communications in minimum time, allowing you to focus on your application's user experience and business logic. We currently support audio and video calls between two web or app users, and phone calls between a web or an app user and an actual phone device.

Here you will find an overview and a quick guide on how to connect to Infobip platform. There is also an in-depth reference documentation available.

### First-time setup
In order to use Infobip RTC, you need to have Web and In-app Calls enabled on your account and that's it! You are ready to make Web and In-app calls. To learn how to enable them see [the documentation](https://www.infobip.com/docs/voice-and-video/web-and-in-app-calls#set-up-web-and-in-app-calls).

### Getting SDK
You can get our SDK through Gradle dependency which you pull from the jCenter maven repository. Just add this snippet to your`build.gradle`:
You can get our SDK through Gradle dependency which you pull from the jCenter maven repository. Just add this snippet to your `build.gradle`:
```
dependencies {
...
Expand Down Expand Up @@ -58,7 +58,7 @@ CallOptions callOptions = CallOptions.builder().video(true).build();
OutgoingCall call = InfobipRTC.call(callRequest, callOptions);
```

As you can see, [`call`](https://github.com/infobip/infobip-rtc-android/wiki/InfobipRTC#call) method returns an instance of [`OutgoingCall`](https://github.com/infobip/infobip-rtc-android/wiki/OutgoingCall) as a result. With it, you can track status of your call and invoke call actions. The `callEventListener` parameter, let’s you set up event handlers, so you can perform something when the called subscriber answers the call, rejects it, the call is ended, etc. You set up event handlers with the following code:
As you can see, [`call`](https://github.com/infobip/infobip-rtc-android/wiki/InfobipRTC#call) method returns an instance of [`OutgoingCall`](https://github.com/infobip/infobip-rtc-android/wiki/OutgoingCall) as a result. With it, you can track status of your call and invoke call actions. The `callEventListener` parameter, lets you set up event handlers, so you can perform something when the called subscriber answers the call, rejects it, the call is ended, etc. You set up event handlers with the following code:

```
CallEventListener callEventListener = new CallEventListener() {
Expand Down Expand Up @@ -90,8 +90,8 @@ CallEventListener callEventListener = new CallEventListener() {
```

The most important part of the call is definitely the media that travels between subscribers. It starts after the `established` event is received.
In case of audio call, you don’t have to do anything to enable the media flow (receive caller audio and send your audio to the caller), it is done automatically.
In case of video call, you need to attach video track received in `established` event to video UI element. You can use `com.infobip.webrtc.sdk.api.video.VideoRenderer` class to display remote video (and local, if you wish) on UI:
In case of audio call, you don’t have to do anything to enable the media flow (receive the caller audio and send your audio to the caller), it is done automatically.
In case of video call, you need to attach the video track received in `established` event to video UI element. You can use `com.infobip.webrtc.sdk.api.video.VideoRenderer` class to display remote video (and local, if you wish) on the UI:
```
<com.infobip.webrtc.sdk.api.video.VideoRenderer
android:id="@+id/remote_video"
Expand All @@ -108,7 +108,7 @@ protected void onCreate(Bundle savedInstanceState) {
remoteVideoRenderer.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT); // choose scaling type that best fits your needs
}
```
When `established` event is received, connect video track to renderer:
When `established` event is received, connect the video track to renderer:
```
@Override
public void onEstablished(CallEstablishedEvent callEstablishedEvent) {
Expand Down Expand Up @@ -144,7 +144,7 @@ To check if audio is muted, call [`muted`](https://github.com/infobip/infobip-rt
boolean audioMuted = outgoingCall.muted();
```

Sound can also be played on speakerphone during the call. That option can be toggled as many times as you like, just call the [`speakerphone`](https://github.com/infobip/infobip-rtc-android/wiki/Call#speakerphone) method with the appropriate parameter. By default, it is disabled, you can enable it as shown below:
Sound can also be played on the speakerphone during the call. That option can be toggled as many times as you like, just call the [`speakerphone`](https://github.com/infobip/infobip-rtc-android/wiki/Call#speakerphone) method with the appropriate parameter. By default, it is disabled, you can enable it as shown below:

```
outgoingCall.speakerphone(true);
Expand Down Expand Up @@ -195,7 +195,7 @@ There are two ways of receiving a call. Each one requires you to listen for inco
The first way is to listen for push notifications which we send from our platform on your behalf to the correct device and in that case you need to provide us your FCM server key. After that, you handle them in your application by extending [`FirebaseMessagingService`](https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/FirebaseMessagingService) and overriding the `onMessageReceived` method. There you can relay push notification to our SDK via [`handleIncomingCall`](https://github.com/infobip/infobip-rtc-android/wiki/InfobipRTC#handleIncomingCall) method. [Here](https://firebase.google.com/docs/android/setup) you can find complete tutorial on how to add Firebase to your app.

This is the recommended approach since it doesnt use much battery, as the connection is not kept alive, it only listens for incoming push notifications.
This is the recommended approach since it doesn't use much battery, as the connection is not kept alive, it only listens for incoming push notifications.

This is an example how to listen for push notifications:
```
Expand All @@ -206,7 +206,7 @@ InfobipRTC.enablePushNotification(
);
```

And then, you can handle that in your application as shown below:
After which you can handle that in your application as shown below:
```
class FcmService extends FirebaseMessagingService {
@Override
Expand Down Expand Up @@ -317,7 +317,7 @@ ConferenceRequest conferenceRequest = new ConferenceRequest(
```

After the user successfully joined the conference, the [`JoinedEvent`](https://github.com/infobip/infobip-rtc-android/wiki/JoinedEvent) event with a list of `users` that are already in that conference room, will be emitted, so that you can show those users on his screen.
And also, the rest of the users will receive [`UserJoinedEvent`](https://github.com/infobip/infobip-rtc-android/wiki/UserJoinedEvent) event, with information about the user that just joined the conference, so that you could show that user on their screens.
Also, the rest of the users will receive [`UserJoinedEvent`](https://github.com/infobip/infobip-rtc-android/wiki/UserJoinedEvent) event, with information about the user that just joined the conference, so that you could show that user on their screens.

When you made [`ConferenceRequest`](https://github.com/infobip/infobip-rtc-android/wiki/ConferenceRequest), you have already implemented [`ConferenceEventListener`](https://github.com/infobip/infobip-rtc-android/wiki/ConferenceEventListener) as an event handler for these events.

Expand All @@ -344,13 +344,13 @@ To check if the audio is muted, call the [`muted()`](https://github.com/infobip/
boolean audioMuted = conference.muted();
```

During the conference call, you can play the audio on speakerphone, by calling the [`speakerphone(enabled)`](https://github.com/infobip/infobip-rtc-android/wiki/Conference#speakerphone) method in the following way:
During the conference call, you can play audio on the speakerphone, by calling the [`speakerphone(enabled)`](https://github.com/infobip/infobip-rtc-android/wiki/Conference#speakerphone) method in the following way:

```
conference.speakerphone(true);
```

To check if the audio is on speakerphone, call the [`speakerphone()`](https://github.com/infobip/infobip-rtc-android/wiki/Conference#speakerphone) method in the following way:
To check if audio is on the speakerphone, call the [`speakerphone()`](https://github.com/infobip/infobip-rtc-android/wiki/Conference#speakerphone) method in the following way:

```
boolean speakerphone = conference.speakerphone();
Expand Down

0 comments on commit faf4385

Please sign in to comment.