Skip to content

Commit 9d3f46d

Browse files
authored
small changes and doc fixes (#665)
1 parent e32b81b commit 9d3f46d

File tree

12 files changed

+57
-50
lines changed

12 files changed

+57
-50
lines changed

docusaurus/docs/Flutter/03-core-concepts/01-authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ factory StreamVideo(
2626
muteAudioWhenInBackground: false,
2727
autoConnect: true,
2828
includeUserDetailsForAutoConnect: true,
29+
keepConnectionsAliveWhenInBackground: false,
2930
),
3031
required User user,
3132
String? userToken,
3233
TokenLoader? tokenLoader,
3334
OnTokenUpdated? onTokenUpdated,
3435
bool failIfSingletonExists = true,
3536
PNManagerProvider? pushNotificationManagerProvider,
36-
CallTypeFactory? customCallTypeFactory,
3737
});
3838
```
3939

docusaurus/docs/Flutter/03-core-concepts/03-call-state.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Overall, `callParticipants` is a powerful tool that provides you with a lot of c
6767
- Viewport Visibility
6868

6969
```dart
70-
for(final user in call.state.value.callParticipants){
71-
if(user.isdominantSpeaker){
72-
setState(()=> dominantSpeaker = user);
73-
}
70+
for (final user in call.state.value.callParticipants){
71+
if (user.isDominantSpeaker){
72+
setState(() => dominantSpeaker = user);
73+
}
7474
}
7575
```
7676

docusaurus/docs/Flutter/03-core-concepts/04-camera-and-microphone.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ For this, the `RtcMediaDeviceNotifier` can be used. Encapsulated in this class a
4747

4848
```dart
4949
RtcMediaDeviceNotifier.instance.onDeviceChange.listen((devices) {
50-
final audioInputDevice = devices.where((device) => device.kind == RtcMediaDeviceKind.audioInput);
51-
call.setAudioInputDevice(audioInputDevice.first);
52-
});
50+
final audioInputDevice = devices.where((device) => device.kind == RtcMediaDeviceKind.audioInput);
51+
call.setAudioInputDevice(audioInputDevice.first);
52+
});
5353
```
5454

5555
For the times where listening to hardware changes are not required, convince methods can be used to fetch the connected devices by their `RtcMediaDeviceKind`.

docusaurus/docs/Flutter/03-core-concepts/05-call-types.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import CallTypesPage from "../../../shared/video/_call-types.md";
1010
When you create a call like this
1111

1212
```dart
13-
final call = client.makeCall(callType: StreamCallType(), "123")
13+
final call = client.makeCall(callType: StreamCallType(), id: "123");
1414
```
1515

1616
You create a call of the type `default` with id `123`.
@@ -20,7 +20,7 @@ There are 4 built-in call types, `default`, `audio_room`, `livestream` and `deve
2020
You can also create your own types by calling `StreamCallType.custom`.
2121

2222
```dart
23-
final call = client.makeCall(callType: StreamCallType.custom("custom"), "123")
23+
final call = client.makeCall(callType: StreamCallType.custom("custom"), id: "123");
2424
```
2525

2626
:::note

docusaurus/docs/Flutter/03-core-concepts/06-querying-calls.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ To add a sort, it is simple as specifying a list of sorts to the `queryCalls` fu
6767

6868
```dart
6969
final result = await video.queryCalls(
70+
// ...
7071
sorts: [
7172
SortParamRequest(field: 'starts_at', direction: -1),
7273
],

docusaurus/docs/Flutter/03-core-concepts/07-permission-and-moderation.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ call.requestPermissions([CallPermission.screenshare, CallPermission.sendVideo]);
2727
As a call admin, you can grant permission to other users by calling `call.grantPermissions` along with the user’s `id` and the list of permissions you would like to grant:
2828

2929
```dart
30-
call.grantPermissions(userId: 'nash', [CallPermission.screenshare, CallPermission.sendVideo])
31-
30+
call.grantPermissions(userId: 'nash', permissions: [CallPermission.screenshare, CallPermission.sendVideo]);
3231
```
3332

3433
During a call, it is advised to set up a handler to listen and react to permission requests as they arrive. This can be done by passing a callback function to the `onPermissionRequest` property present on the `Call` object:
@@ -62,8 +61,7 @@ To facilitate these requests, the SDK provides several methods for limiting user
6261
Similar to its sister method `grantPermissions`, the `revokePermissions` method exists on the current `Call` object. It enables users to easily remove permissions assigned to a specific user by providing their user ID and the list of permissions to be revoked..
6362

6463
```dart
65-
call.revokePermissions(userId: 'nash', [CallPermission.screenshare, CallPermission.sendVideo]);
66-
64+
call.revokePermissions(userId: 'nash', permissions: [CallPermission.screenshare, CallPermission.sendVideo]);
6765
```
6866

6967
**Mute Users**
@@ -75,7 +73,6 @@ call.muteAllUsers();
7573
```
7674

7775
```dart
78-
7976
call.muteUsers(userIds: ['thierry']);
8077
```
8178

@@ -90,7 +87,6 @@ In the above example, we are only muting a single user. However, `muteUsers` doe
9087
Blocking and unblocking users can be done by calling `blockUser` or `unblockUser` on the current `Call` object.
9188

9289
```dart
93-
9490
call.blockUser('deven');
9591
9692
call.unblockUser('deven');

docusaurus/docs/Flutter/04-ui/02-call-container.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ Developers can easily respond to user actions, such as accepting or declining a
3434
To replace default screens, such as the one displayed when an incoming call is detected, developers can use one of the many optional builders available.
3535

3636
```dart
37-
@override
37+
@override
3838
Widget build(BuildContext context) {
39-
return Scaffold(
40-
body: StreamCallContainer(
41-
call: widget.call,
42-
incomingCallBuilder: (context, call, callState) {
43-
return CustomIncomingCallScreen(call: call, state: callState);
44-
},
45-
),
46-
);
39+
return Scaffold(
40+
body: StreamCallContainer(
41+
call: widget.call,
42+
incomingCallBuilder: (context, call, callState) {
43+
return CustomIncomingCallScreen(call: call, state: callState);
44+
},
45+
),
46+
);
47+
}
4748
```
4849

4950
All the `builders` exposed by `StreamCallContainer` provide users with an ongoing `Call` object and the associated `CallState`. These can be used to subscribe to changes and display different UI options depending on the events.

docusaurus/docs/Flutter/04-ui/03-video-render.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ When in doubt, we recommend starting with `StreamCallParticipant` unless there i
1818
### Customizing `StreamCallParticipant`
1919

2020
```dart
21-
const StreamCallParticipant({
21+
const StreamCallParticipant({
2222
super.key,
2323
required this.call,
2424
required this.participant,
25+
this.videoFit,
2526
this.backgroundColor,
2627
this.borderRadius,
2728
this.userAvatarTheme,
@@ -49,7 +50,7 @@ Call Participant allows you to customize everything from the background color an
4950
To use the widget, you need to supply two arguments: the current `call` and `participant` to render. Both of these parameters can be fetched from either `activeCall` or `callState`.
5051

5152
```dart
52-
StreamCallContent(
53+
StreamCallContent(
5354
call: call,
5455
callState: callState,
5556
callParticipantsBuilder: (context, call, callState) {
@@ -64,7 +65,7 @@ StreamCallContent(
6465
### Using `StreamVideoRenderer` directly:
6566

6667
```dart
67-
StreamCallContent(
68+
StreamCallContent(
6869
call: call,
6970
callState: callState,
7071
callParticipantsBuilder: (context, call, callState) {

docusaurus/docs/Flutter/04-ui/04-call-content.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Similar to `StreamCallContainer`, `CallContent` allows for the display of partic
99
However, unlike `StreamCallContainer`, the sole responsibility of `StreamCallContent` is to render the call participants and controls. `StreamCallContent` does not monitor or respond to call lifecycle events, such as incoming and outgoing calls.
1010

1111
```dart
12-
const StreamCallContent({
12+
const StreamCallContent({
1313
super.key,
1414
required this.call,
1515
required this.callState,
@@ -19,6 +19,9 @@ const StreamCallContent({
1919
this.overlayAppBarBuilder,
2020
this.callParticipantsBuilder,
2121
this.callControlsBuilder,
22+
this.layoutMode = ParticipantLayoutMode.grid,
23+
this.enablePictureInPicture = false,
24+
this.callPictureInPictureBuilder,
2225
});
2326
```
2427

docusaurus/docs/Flutter/04-ui/06-video-theme.mdx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,20 @@ Some high-level properties such as `textTheme` or `colorTheme` can be set applic
3131
In contrast, larger components such as `StreamCallParticipant`, `StreamLobbyView`, etc. have been addressed with smaller theme objects.
3232

3333
```dart
34-
factory StreamVideoTheme({
35-
required Brightness brightness,
36-
StreamTextTheme? textTheme,
37-
StreamColorTheme? colorTheme,
38-
StreamCallControlsThemeData? callControlsTheme,
39-
StreamUserAvatarThemeData? userAvatarTheme,
40-
StreamLobbyViewThemeData? lobbyViewTheme,
41-
StreamCallParticipantThemeData? callParticipantTheme,
42-
StreamLocalVideoThemeData? localVideoTheme,
43-
StreamIncomingOutgoingCallThemeData? incomingCallTheme,
44-
StreamIncomingOutgoingCallThemeData? outgoingCallTheme,
45-
});
34+
factory StreamVideoTheme({
35+
required Brightness brightness,
36+
StreamTextTheme? textTheme,
37+
StreamColorTheme? colorTheme,
38+
StreamCallContentThemeData? callContentTheme,
39+
StreamCallControlsThemeData? callControlsTheme,
40+
StreamUserAvatarThemeData? userAvatarTheme,
41+
StreamLobbyViewThemeData? lobbyViewTheme,
42+
StreamCallParticipantThemeData? callParticipantTheme,
43+
StreamLocalVideoThemeData? localVideoTheme,
44+
StreamIncomingOutgoingCallThemeData? incomingCallTheme,
45+
StreamIncomingOutgoingCallThemeData? outgoingCallTheme,
46+
StreamLivestreamThemeData? livestreamTheme,
47+
});
4648
```
4749

4850
### Stream Video Theme in use

0 commit comments

Comments
 (0)