Skip to content

Commit 914e968

Browse files
Merge branch 'develop'
2 parents 448590e + d7a2c5a commit 914e968

File tree

19 files changed

+353
-229
lines changed

19 files changed

+353
-229
lines changed

buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ object Configuration {
66
const val minSdk = 24
77
const val majorVersion = 1
88
const val minorVersion = 0
9-
const val patchVersion = 1
9+
const val patchVersion = 2
1010
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
11-
const val versionCode = 24
11+
const val versionCode = 25
1212
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
1313
const val artifactGroup = "io.getstream"
14-
const val streamVideoCallGooglePlayVersion = "1.1.1"
14+
const val streamVideoCallGooglePlayVersion = "1.1.2"
1515
const val streamWebRtcVersionName = "1.1.1"
1616
}

docusaurus/docs/Android/02-tutorials/01-video-calling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
3131
```kotlin
3232
dependencies {
3333
// Stream Video Compose SDK
34-
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
34+
implementation("io.getstream:stream-video-android-ui-compose:1.0.2")
3535

3636
// Optionally add Jetpack Compose if Android studio didn't automatically include them
3737
implementation(platform("androidx.compose:compose-bom:2023.08.00"))

docusaurus/docs/Android/02-tutorials/02-audio-room.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
3535
```groovy
3636
dependencies {
3737
// Stream Video Compose SDK
38-
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
38+
implementation("io.getstream:stream-video-android-ui-compose:1.0.2")
3939
4040
// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
4141
implementation(platform("androidx.compose:compose-bom:2023.08.00"))

docusaurus/docs/Android/02-tutorials/03-livestream.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you're new to android, note that there are 2 `build.gradle` files, you want t
3535
```kotlin
3636
dependencies {
3737
// Stream Video Compose SDK
38-
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
38+
implementation("io.getstream:stream-video-android-ui-compose:1.0.2")
3939

4040
// Jetpack Compose (optional/ android studio typically adds them when you create a new project)
4141
implementation(platform("androidx.compose:compose-bom:2023.08.00"))

docusaurus/docs/Android/05-ui-cookbook/17-pin-participants.mdx renamed to docusaurus/docs/Android/05-ui-cookbook/15-pin-participants.mdx

File renamed without changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Watching a Livestream
2+
3+
This guide describes how to watch a livestream using our SDK.
4+
5+
:::note
6+
- Read our [tutorial](https://getstream.io/video/sdk/android/tutorial/livestreaming) for more info on how to implement livestreaming host and viewer apps.
7+
- Go to the [HLS section](https://getstream.io/video/sdk/android/tutorial/livestreaming/#optional-viewing-a-livestream-with-hls) of our tutorial to find out how to view a HLS livestream.
8+
:::
9+
10+
If you want to watch a WebRTC livestream, then you can either use our `LivestreamPlayer`, or build your own component.
11+
12+
## LivestreamPlayer UI component
13+
14+
The `LivestreamPlayer` component shows the following information:
15+
16+
- _live_ indicator
17+
- number of participants
18+
- duration
19+
- _pause/resume_ on tap functionality
20+
- _mute/unmute_ incoming sound
21+
22+
### Basic usage
23+
24+
For standard usage, you just need to pass a `call` object:
25+
26+
```kotlin
27+
LivestreamPlayer(call = call)
28+
```
29+
30+
![watching-livestream-1.png](../assets/cookbook/watching-livestream-1.png)
31+
32+
### Customization
33+
34+
This is the full signature of the component:
35+
36+
```kotlin
37+
@Composable
38+
public fun LivestreamPlayer(
39+
modifier: Modifier = Modifier,
40+
call: Call,
41+
enablePausing: Boolean,
42+
onPausedPlayer: ((isPaused: Boolean) -> Unit)?,
43+
backstageContent: @Composable BoxScope.(Call) -> Unit,
44+
rendererContent: @Composable BoxScope.(Call) -> Unit,
45+
overlayContent: @Composable BoxScope.(Call) -> Unit
46+
)
47+
```
48+
49+
- `modifier`: Used to apply styling to the component, such as extra borders, background, elevation, size or shape and more.
50+
- `call`: The livestream call to watch.
51+
- `enablePausing`: Controls the _pause/resume_ on tap functionality.
52+
- `onPausedPlayer`: Event handler for the _pause/resume_ on tap event.
53+
- `backstageContent`: Content to show when the call is in backstage mode (i.e. the host has not started the livestream yet)
54+
- `rendererContent`: Used to control how the video feed is rendered on screen. By default, it uses the `VideoRenderer` component under the hood.
55+
- `overlayContent`: Used for customizing the overlay that contains participant count, duration and other info.

docusaurus/docs/Android/06-advanced/01-ringing.mdx

Lines changed: 92 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,117 @@
22
title: Ringing
33
description: How to ring the call and notify all members
44
---
5+
The `Call` object provides several options to ring and notify users about a call.
6+
### Create and start a ringing call
57

6-
## Ring & Notify
7-
8-
You can ring or notify a call. Ring triggers an incoming call style UI for all members of the call.
9-
Notify is a smaller notification. Commonly used when someone starts a livestream, joins a zoom style call etc.
8+
To create a ring call, we need to set the `ring` flag to `true` and provide the list of members we want to call. It is important to note that the caller should also be included in the list of members.
9+
For this, you can use the `create` method from the `Call` object.
10+
```kotlin
11+
val call = client.call("default", "123")
12+
call.create(ring = true, members = listOf("caller-id", "receiver-1", "receiver-2"))
13+
```
14+
When ring is `true`, a push notification will be sent to the members, provided you have the required setup for push notifications.
15+
For more details around push notifications, please check [this page](./02-push-notifications/01-overview.mdx).
16+
If ring is `false`, no push notification will be sent.
1017

18+
### Ring an existing call
19+
If you are sure that a call exists, you can use the `get` method instead:
1120
```kotlin
1221
val call = client.call("default", "123")
13-
call.create()
22+
call.get()
1423
call.ring()
15-
call.notify()
16-
17-
// you can also ring and notify as a side effect of joining or creating a call
18-
call.create(ring=true, notify=false)
19-
call.join(ring=true, notify=false)
2024
```
25+
The `get()` - `ring()` combination is better used for when calls are created and managed externally via another system.
2126

22-
Users who receive the incoming call can either accept or reject it.
23-
27+
### Monitor the outgoing call state
28+
The state of the ringing call is available via the `StreamVideo` client.
2429
```kotlin
25-
call.accept()
26-
call.reject()
30+
val client = StreamVideo.instance()
31+
val ringingCall = client.state.ringingCall
2732
```
28-
29-
The state for ringing calls is available here:
33+
This will give you a `StateFlow` which can be monitored.
34+
```kotlin
35+
ringingCall.collectLatest { call ->
36+
// There is a ringing call
37+
}
38+
```
39+
or simply just get a current value.
40+
```kotlin
41+
val call = ringingCall.value
42+
```
43+
### Canceling an outgoing call
44+
To cancel an outgoing call you can simply `reject` the call from the caller side.
45+
The `reject()` method will notify the endpoint that the call is being rejected and corresponding
46+
events will be sent. In order to cleanup on the caller side, a call to `leave()` is required.
47+
These two usually go together, unless there is a specific reason to keep the channel open for further
48+
events.
3049

3150
```kotlin
32-
val incomingCall = client.state.incomingCall.value
33-
val accepted = call.state.acceptedBy.value // list of user ids who accepted
34-
val rejected = call.state.rejectedBy.value // list of user ids who rejected
51+
call.reject()
52+
call.leave()
3553
```
3654

37-
### Push Setup
55+
### Handle an incoming call
3856

39-
3 types of push notifications are triggered:
57+
If you have setup [push notifications](./02-push-notifications/01-overview.mdx) properly a "member"
58+
will receive a push notification about an incoming call.
4059

41-
* call.ring
42-
* call.notification
43-
* call.live_started
60+
By default the SDK will show the push notification (with a call style) with an option to either
61+
accept or decline the call.
62+
63+
When the user clicks on a push notification. There is an intent fired `ACTION_REJECT_CALL` or `ACTION_ACCEPT_CALL`.
64+
The
4465

4566
You can learn more about how to setup [push notifications in the docs](./02-push-notifications/01-overview.mdx).
4667
The docs also explain how to customize the notifications.
4768

48-
### Incoming Calls
69+
### Accept an incoming call
70+
71+
The compose SDK provides built-in components to render and handle an incoming call.
4972

50-
The compose SDK provides built-in components to render an incoming call.
73+
One of them is `StreamCallActivity`. This abstract activity handles everything that is needed for a call.
74+
Stream also provides a default compose implementation of this activity called `ComposeStreamCallActivity`.
5175

76+
These components are already predefined and registered in the SDK. If you want to customize them you can easily extend them as any other activity in Android.
77+
78+
For more details check:
5279
* [UI Component docs for incoming calls](../04-ui-components/04-call/04-ringing-call.mdx)
53-
* UI Cookbook how to build [your own incoming call UI](../05-ui-cookbook/05-incoming-and-outgoing-call.mdx)
80+
* UI Cookbook how to build [your own incoming call UI](../05-ui-cookbook/05-incoming-and-outgoing-call.mdx)
81+
82+
The Stream SDK provides a way to accept a call within the code so if you are building a new UI, you can do this via the SDK API.
83+
```kotlin
84+
call.accept()
85+
call.join()
86+
```
87+
The above calls are all you need to accept and join a call.
88+
89+
Its important to note that if there is already an ongoing call you first have to leave that call.
90+
```kotlin
91+
val client = StreamVideo.instance()
92+
val activeCall = client.start.activeCall.value
93+
if (activeCall != null) {
94+
activeCall.leave()
95+
}
96+
```
97+
All this needs to be done with a component that handles the accept action.
98+
```xml
99+
<action android:name="io.getstream.video.android.action.ACCEPT_CALL" />
100+
```
101+
102+
### Reject an incoming call
103+
104+
Clicking the notification will automatically reject the call.
105+
There are certain instances that you might want to do this manually in your code.
106+
107+
Stream offers a simple API to do this.
108+
```kotlin
109+
call.reject()
110+
```
111+
112+
Note that rejecting the call will notify the caller and other members that the participant rejected
113+
the call. However it will not clean up the local `call` state.
114+
For this you need to leave the call by using:
115+
```kotlin
116+
call.leave()
117+
```
118+

docusaurus/docs/Android/06-advanced/07-chat-with-video.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Let the project sync. It should have all the dependencies required for you to fi
3131
```groovy
3232
dependencies {
3333
// Stream Video Compose SDK
34-
implementation("io.getstream:stream-video-android-ui-compose:1.0.1")
34+
implementation("io.getstream:stream-video-android-ui-compose:1.0.2")
3535
3636
// Stream Chat
3737
implementation(libs.stream.chat.compose)
434 KB
Loading

stream-video-android-core/api/stream-video-android-core.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public final class io/getstream/video/android/core/CallState {
174174
public final fun updateFromResponse (Lorg/openapitools/client/models/StopLiveResponse;)V
175175
public final fun updateFromResponse (Lorg/openapitools/client/models/UpdateCallResponse;)V
176176
public final fun updateParticipant (Lio/getstream/video/android/core/ParticipantState;)V
177+
public final fun updateParticipantSortingOrder (Ljava/util/Comparator;)V
177178
public final fun updateParticipantVisibility (Ljava/lang/String;Lio/getstream/video/android/core/model/VisibilityOnScreenState;)V
178179
public final fun updateParticipantVisibilityFlow (Lkotlinx/coroutines/flow/Flow;)V
179180
public final fun upsertParticipants (Ljava/util/List;)V
@@ -5907,6 +5908,7 @@ public final class io/getstream/video/android/model/User$$serializer : kotlinx/s
59075908
}
59085909

59095910
public final class io/getstream/video/android/model/User$Companion {
5911+
public final fun anonymous ()Lio/getstream/video/android/model/User;
59105912
public final fun serializer ()Lkotlinx/serialization/KSerializer;
59115913
}
59125914

0 commit comments

Comments
 (0)