You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to manually select the incoming video quality in the Stream Video Flutter SDK.
6
+
---
7
+
8
+
By default, our SDK chooses the incoming video quality that best matches the size of a video element for a given participant. It makes less sense to waste bandwidth receiving Full HD video when it's going to be displayed in a 320 by 240 pixel rectangle.
9
+
10
+
However, it's still possible to override this behavior and manually request higher resolution video for better quality, or lower resolution to save bandwidth. It's also possible to disable incoming video altogether for an audio-only experience.
11
+
12
+
## Overriding Preferred Resolution
13
+
14
+
To override the preferred incoming video resolution, use the `call.setPreferredIncomingVideoResolution` method:
Actual incoming video quality depends on a number of factors, such as the quality of the source video, and network conditions. Manual video quality selection allows you to specify your preference, while the actual resolution is automatically selected from the available resolutions to match that preference as closely as possible.
22
+
:::
23
+
24
+
It's also possible to override the incoming video resolution for only a selected subset of call participants. The `call.setPreferredIncomingVideoResolution()` method optionally takes a list of participant session identifiers as its optional argument. Session identifiers can be obtained from the call participant state:
25
+
26
+
```dart
27
+
final [first, second, ..._] = call.state.value.otherParticipants;
28
+
29
+
// Set preferred incoming video resolution for the first two participants only:
30
+
await call.setPreferredIncomingVideoResolution(
31
+
VideoResolution(width: 640, height: 480),
32
+
sessionIds: [first.sessionId, second.sessionId],
33
+
);
34
+
```
35
+
36
+
Calling this method will enable incoming video for the selected participants if it was previously disabled.
37
+
38
+
To clear a previously set preference, pass `null` instead of resolution:
39
+
40
+
```dart
41
+
// Clear resolution preference for selected participants:
42
+
await call.setPreferredIncomingVideoResolution(
43
+
null,
44
+
sessionIds: [
45
+
participant.sessionId,
46
+
],
47
+
);
48
+
// Clear resolution preference for all participants:
description: Learn how to limit the maximum duration of a call in the Stream Video Flutter SDK.
6
+
---
7
+
8
+
A session timer allows you to limit the maximum duration of a call. The duration [can be configured](https://getstream.io/video/docs/api/calls/#session-timers) for all calls of a certain type, or on a per-call basis. When a session timer reaches zero, the call automatically ends.
9
+
10
+
## Creating a call with a session timer
11
+
12
+
Let's see how to create a single call with a limited duration:
13
+
14
+
```dart
15
+
final call = client.makeCall(callType: StreamCallType.defaultType(), id: 'REPLACE_WITH_CALL_ID');
16
+
await call.getOrCreate(
17
+
limits: const StreamLimitsSettings(
18
+
maxDurationSeconds: 3600,
19
+
),
20
+
);
21
+
```
22
+
23
+
This code creates a call with a duration of 3600 seconds (1 hour) from the time the session is starts (a participant joins the call).
24
+
25
+
After joining the call with the specified `maxDurationSeconds`, you can examine a call state's `timerEndsAt` field, which provides the timestamp when the call will end. When a call ends, all participants are removed from the call.
26
+
27
+
```dart
28
+
await call.join();
29
+
print(call.state.value.timerEndsAt);
30
+
```
31
+
32
+
## Extending a call
33
+
34
+
You can also extend the duration of a call, both before or during the call. To do that, you should use the `call.update` method:
If the call duration is extended, the `timerEndsAt` is updated to reflect this change. Call participants will receive the `call.updated` event to notify them about this change.
Copy file name to clipboardExpand all lines: packages/stream_video/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ This release introduces a major rework of the join/reconnect flow in the Call cl
17
17
* Added `participantCount` and `anonymousParticipantCount` to `CallState` reflecting the current number of participants in the call.
18
18
* Introduced the `watch` parameter to `Call.get()` and `Call.getOrCreate()` methods (default is `true`). When set to `true`, this enables the `Call` to listen for coordinator events and update its state accordingly, even before the call is joined (`Call.join()`).
19
19
* Added support for `targetResolution` setting set on the Dashboard to determine the max resolution the video stream.
20
+
* Introduced new API methods to give greater control over incoming video quality. `Call.setPreferredIncomingVideoResolution()` allows you to manually set a preferred video resolution, while `Call.setIncomingVideoEnabled()` enables or disables incoming video. For more details, refer to the [documentation](https://getstream.io/video/docs/flutter/manual-video-quality-selection/).
20
21
21
22
🐞 Fixed
22
23
* Automatic push token registration by `StreamVideo` now stores registered token in `SharedPreferences`, performing an API call only when the token changes.
0 commit comments