|
1 | 1 | # Auvious Android SDK Example |
2 | | -This repo contains example of how to use AuviousSDK. |
3 | | - |
4 | | -To use AuviousSDK in your project follow these steps: |
5 | | -- Add `https://nexus.auvious.com/repository/maven-releases` nexus repository. If you are using gradle |
6 | | - then your build.gradle repositories section should look something like this: |
7 | | - ```groovy |
8 | | - repositories { |
9 | | - mavenCentral() |
10 | | - // ... other repositories |
11 | | - // Auvious SDK Repo |
12 | | - maven { url "https://nexus.auvious.com/repository/maven-releases" } |
13 | | - } |
14 | | - ``` |
15 | | -- Include `com.auvious.android:sdk:1.0.15` dependency. Again if you are using Gradle, then your |
16 | | - build.gradle dependencies section would look like this: |
17 | | - ```groovy |
18 | | - dependencies { |
19 | | - //... other dependencies |
20 | | - |
21 | | - // Auvious SDK |
22 | | - implementation 'com.auvious.android:sdk:1.0.15' |
23 | | - } |
24 | | - ``` |
25 | | - |
26 | | -- Launch `AuviousSimpleConferenceActivity` to join a call with ticket like this: |
27 | | - ```kotlin |
28 | | - val callOptions = AuviousSimpleConferenceOptions( |
29 | | - "customer", |
30 | | - "https://auvious.video", |
31 | | - "wss://auvious.video/ws", |
32 | | - mapOf( |
33 | | - "ticket" to edit_ticket.text.toString(), |
34 | | - "grant_type" to "password", |
35 | | - "mic" to "true", |
36 | | - "camera" to "true", |
37 | | - "speaker" to "false" |
38 | | - ) |
39 | | - ) |
40 | | - |
41 | | - val startForResult = |
42 | | - registerForActivityResult(ActivityResultContracts.StartActivityForResult()) |
43 | | - { result: ActivityResult -> |
44 | | - if (result.resultCode != Activity.RESULT_OK) { |
45 | | - // you will get result here in result.data |
46 | | - result.data?.getParcelableExtra<AuviousSdkSimpleConferenceError>( |
47 | | - AuviousSimpleConferenceActivity.getResultIntentName() |
48 | | - )?.let { |
49 | | - Toast.makeText(this, "Error code is ${it.errorCode}", Toast.LENGTH_LONG) |
50 | | - .show() |
51 | | - } |
52 | | - } |
53 | | - AuviousConferenceSDK.instance.onDestroy() |
54 | | - } |
55 | | - startForResult.launch(AuviousSimpleConferenceActivity.getIntent(this, callOptions)) |
56 | | - ``` |
57 | | -Within the `mapOf()` configuration, there are three options for initializing the microphone, camera, and speaker for the call session. Here's how they work and how to adjust them: |
58 | | - |
59 | | -**Microphone Configuration** |
60 | | -- Key: `mic` |
61 | | -- Value: `true` or `false` |
62 | | - - `true`: This enables the microphone, allowing the user to send audio during the call. |
63 | | - - `false`: This disables the microphone, so the user will not be able to send audio. However, they can still hear audio if the speaker is enabled. |
64 | | - |
65 | | -**Camera Configuration** |
66 | | -- Key: `camera` |
67 | | -- Value: `true` or `false` |
68 | | - - `true`: This enables the camera, allowing the user to send video during the call. |
69 | | - - `false`: This disables the camera, so the user will not send video. However, they can still see the video from other participants. |
70 | | - |
71 | | -**Speaker Configuration** |
72 | | -- Key: `speaker` |
73 | | -- Value: `true` or `false` |
74 | | -- `true`: This enables the speaker, allowing the user to hear audio from other participants. |
75 | | -- `false`: This disables the speaker, so the user will hear sound by device's earpiece. |
| 2 | +This repository contains an example of how to use the AuviousSDK in an Android project. |
| 3 | + |
| 4 | +To use the AuviousSDK in your project, follow these steps: |
| 5 | + |
| 6 | +## Setup Instructions |
| 7 | + |
| 8 | +1. Add `https://nexus.auvious.com/repository/maven-releases` as a Nexus repository. If you're using Gradle, add this to your `build.gradle` repositories section: |
| 9 | + ```groovy |
| 10 | + repositories { |
| 11 | + mavenCentral() |
| 12 | + // ... other repositories |
| 13 | + // Auvious SDK Repo |
| 14 | + maven { url "https://nexus.auvious.com/repository/maven-releases" } |
| 15 | + } |
| 16 | + ``` |
| 17 | + |
| 18 | +2. Include the Auvious SDK dependency. Add this line to your `build.gradle` dependencies section: |
| 19 | + ```groovy |
| 20 | + dependencies { |
| 21 | + //... other dependencies |
| 22 | + // Auvious SDK |
| 23 | + implementation 'com.auvious.android:sdk:1.1.1' |
| 24 | + } |
| 25 | + ``` |
| 26 | + |
| 27 | +## Usage Example |
| 28 | + |
| 29 | +To start a conference, use the `AuviousSimpleConferenceActivity` with configurable call options, such as microphone, camera, and speaker settings: |
| 30 | + |
| 31 | +```kotlin |
| 32 | +private fun startSimpleConferenceActivity( |
| 33 | + enableMic: Boolean = true, |
| 34 | + enableCam: Boolean = true, |
| 35 | + enableEarPieceSpeaker: Boolean = false, |
| 36 | + availableMicButton: Boolean = true, |
| 37 | + availableCamButton: Boolean = true, |
| 38 | + availableSpeakerButton: Boolean = true, |
| 39 | + customConferenceBackgroundColor: Boolean = false |
| 40 | +) { |
| 41 | + val callOptions = AuviousSimpleConferenceOptions( |
| 42 | + "customer", |
| 43 | + "https://auvious.video", |
| 44 | + "wss://auvious.video/ws", |
| 45 | + mapOf( |
| 46 | + "ticket" to binding.ticketText.text.toString(), |
| 47 | + "grant_type" to "password", |
| 48 | + AuviousSimpleConferenceOptions.speakerOption to (!enableEarPieceSpeaker).toString(), |
| 49 | + AuviousSimpleConferenceOptions.microphoneOption to enableMic.toString(), |
| 50 | + AuviousSimpleConferenceOptions.cameraOption to enableCam.toString(), |
| 51 | + AuviousSimpleConferenceOptions.cameraAvailable to availableCamButton.toString(), |
| 52 | + AuviousSimpleConferenceOptions.microphoneAvailable to availableMicButton.toString(), |
| 53 | + AuviousSimpleConferenceOptions.speakerAvailable to availableSpeakerButton.toString(), |
| 54 | + AuviousSimpleConferenceOptions.conferenceBackgroundColor to if (customConferenceBackgroundColor) Color.parseColor("#3366ff").toString() else Color.BLACK.toString() |
| 55 | + ) |
| 56 | + ) |
| 57 | + activityForResult.launch(AuviousSimpleConferenceActivity.getIntent(this, callOptions)) |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +### Option Descriptions |
| 62 | + |
| 63 | +#### Enable default functionality |
| 64 | +- **Microphone Configuration** |
| 65 | + - **Key**: `mic` |
| 66 | + - **Value**: `true` or `false` |
| 67 | + - `true`: Enables the microphone. |
| 68 | + - `false`: Disables the microphone. |
| 69 | + |
| 70 | +- **Camera Configuration** |
| 71 | + - **Key**: `camera` |
| 72 | + - **Value**: `true` or `false` |
| 73 | + - `true`: Enables the camera. |
| 74 | + - `false`: Disables the camera. |
| 75 | + |
| 76 | +- **Speaker Configuration** |
| 77 | + - **Key**: `speaker` |
| 78 | + - **Value**: `true` or `false` |
| 79 | + - `true`: Enables the speaker. |
| 80 | + - `false`: Enables only the earpiece. |
| 81 | + |
| 82 | +#### Available conference control buttons |
| 83 | + - **Microphone Button Availability** |
| 84 | + - **Key**: `mic_available` |
| 85 | + - **Value**: `true` or `false` |
| 86 | + - `true`: The microphone button will be available for toggling on/off. |
| 87 | + - `false`: The microphone button will be hidden. |
| 88 | + |
| 89 | + - **Camera Button Availability** |
| 90 | + - **Key**: `camera_available` |
| 91 | + - **Value**: `true` or `false` |
| 92 | + - `true`: The camera button will be available for toggling on/off. |
| 93 | + - `false`: The camera button will be hidden. |
| 94 | + |
| 95 | + - **Speaker Button Availability** |
| 96 | + - **Key**: `speaker_available` |
| 97 | + - **Value**: `true` or `false` |
| 98 | + - `true`: The speaker button will be available for toggling on/off. |
| 99 | + - `false`: The speaker button will be hidden. |
| 100 | + |
| 101 | +- **Custom Conference Background Color** |
| 102 | + - **Key**: `conference_background_color` |
| 103 | + - **Value**: [Color](https://developer.android.com/reference/android/graphics/Color) object or a hex color by using the [Color.parseColor()](https://developer.android.com/reference/android/graphics/Color#parseColor(java.lang.String)) method |
| 104 | + - Set a custom color in conference background. Otherwise, the default background color will be black. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +With these additional configurations, you have greater control over the UI and functionality within the [Auvious](www.auvious.com) conference experience, allowing you to fine-tune the behavior and appearance for your users. |
0 commit comments