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
This quickstart will help you get started with Azure Communication Services Rooms. A `room` is a server-managed communications space for a known, fixed set of participants to collaborate for a pre-determined duration. The [rooms conceptual documentation](../../concepts/rooms/room-concept.md) covers more details and potential use cases for `rooms`.
20
+
This quickstart will help you get started with Azure Communication Services Rooms. A `room` is a server-managed communications space for a known, fixed set of participants to collaborate for a pre-determined duration. The [rooms conceptual documentation](../../concepts/rooms/room-concept.md) covers more details and use cases for `rooms`.
21
+
22
+
::: zone pivot="programming-language-javascript"
23
+
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-javascript.md)]
24
+
::: zone-end
21
25
22
26
::: zone pivot="programming-language-csharp"
23
27
[!INCLUDE [Use rooms with .NET SDK](./includes/rooms-quickstart-net.md)]
@@ -27,25 +31,31 @@ This quickstart will help you get started with Azure Communication Services Room
27
31
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-java.md)]
28
32
::: zone-end
29
33
34
+
::: zone pivot="programming-language-python"
35
+
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-python.md)]
36
+
::: zone-end
37
+
30
38
## Object model
31
39
32
40
The table below lists the main properties of `room` objects:
To join a room call, set up your web application using the [Add video calling to your client app](../../voice-video-calling/get-started-with-video-calling.md?pivots=platform-android) guide. Alternatively, you can download the video calling quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-android-quickstarts/tree/main/videoCallingQuickstart).
18
+
19
+
Create a `CallAgent` with a valid user token:
20
+
21
+
```Java
22
+
private fun createAgent() {
23
+
val userToken:String= checkNotNull(null){"userToken must be set"}
24
+
25
+
try {
26
+
val credential = CommunicationTokenCredential(userToken)
To join a room call, set up your web application using the [Add video calling to your client app](../../voice-video-calling/get-started-with-video-calling.md?pivots=platform-ios) guide. Alternatively, you can download the video calling quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/Add%20Video%20Calling).
19
+
20
+
You'll need a User Access Token when initializing a CallAgent instance to join room calls. Once you have a token, Add the following code to the `onAppear` callback in `ContentView.swift`. You'll need to replace `<USER ACCESS TOKEN>` with a valid user access token for your resource:
print("ERROR: It was not possible to create user credential.")
28
+
return
29
+
}
30
+
```
31
+
32
+
To create a CallAgent instance from a CallClient, use the `callClient.createCallAgent` method that asynchronously returns a CallAgent object once it's initialized. DeviceManager lets you enumerate local devices that can be used in a call to transmit audio/video streams. It also allows you to request permission from a user to access microphone/camera.
33
+
34
+
```Swift
35
+
self.callClient=CallClient()
36
+
self.callClient?.createCallAgent(userCredential: userCredential!) { (agent, error) in
37
+
if error !=nil {
38
+
print("ERROR: It was not possible to create a call agent.")
39
+
return
40
+
} else {
41
+
self.callAgent= agent
42
+
print("Call agent successfully created.")
43
+
self.callAgent!.delegate= callHandler
44
+
self.callClient?.getDeviceManager { (deviceManager, error) in
45
+
if (error ==nil) {
46
+
print("Got device manager instance")
47
+
self.deviceManager= deviceManager
48
+
} else {
49
+
print("Failed to get device manager instance")
50
+
}
51
+
}
52
+
}
53
+
}
54
+
```
55
+
56
+
The `joinRoomCall` method is set as the action that will be performed when the Join Room Call button is tapped.
57
+
58
+
```Swift
59
+
funcjoinRoomCall() {
60
+
ifself.callAgent ==nil {
61
+
print("CallAgent not initialized")
62
+
return
63
+
}
64
+
65
+
if (self.roomId.isEmpty) {
66
+
print("Room ID not set")
67
+
return
68
+
}
69
+
70
+
// Join a call with a Room ID
71
+
let options =JoinCallOptions()
72
+
let audioOptions =AudioOptions()
73
+
audioOptions.muted=self.muted
74
+
75
+
options.audioOptions= audioOptions
76
+
77
+
let roomCallLocator =RoomCallLocator(roomId: roomId)
78
+
self.callAgent!.join(with: roomCallLocator, joinCallOptions: options) { (call, error) in
79
+
self.setCallAndObserver(call: call, error: error)
80
+
}
81
+
}
82
+
```
83
+
84
+
`CallObserver` is used to manage mid-call events and remote participants. We'll set the observers in the `setCallAndOberserver` function.
To join a room call, set up your web application using the [Add video calling to your client app](../../voice-video-calling/get-started-with-video-calling.md?pivots=platform-web) guide. Alternatively, you can download the video calling quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/add-1-on-1-video-calling).
18
+
19
+
Once you have an initialized and authenticated `callAgent`, you may specify a context object with the `roomId` property as the `room` identifier. To join the call, use the `join` method and pass the context instance.
Include the `azure-sdk-bom` to your project to take dependency on the General Availability (GA) version of the library. In the following snippet, replace the {bom_version_to_target} placeholder with the version number.
@@ -88,9 +89,17 @@ RoomsClient roomsClient = new RoomsClientBuilder().connectionString(connectionSt
88
89
Create a new `room` with default properties using the code snippet below:
participants.add(newRoomParticipant().setCommunicationIdentifier(newCommunicationUserIdentifier("<ACS User MRI identity 1>")).setRole(RoleType.ATTENDEE));
98
+
participants.add(newRoomParticipant().setCommunicationIdentifier(newCommunicationUserIdentifier("<ACS User MRI identity 2>")).setRole(RoleType.CONSUMER));
99
+
participants.add(newRoomParticipant().setCommunicationIdentifier(newCommunicationUserIdentifier("<ACS User MRI identity 3>")).setRole(RoleType.ATTENDEE));
Since `rooms` are server-side entities, you may want to keep track of and persist the `roomId` in the storage medium of choice. You can reference the `roomId` to view or update the properties of a `room` object.
To join a room call, set up your web application using the [Add voice calling to your client app](../../voice-video-calling/getting-started-with-calling.md) guide. Once you have an initialized and authenticated `callAgent`, you may specify a context object with the `roomId` property as the `room` identifier. To join the call, use the `join` method and pass the context instance.
158
-
159
-
```js
160
-
161
-
constcontext= { roomId:'<RoomId>' }
162
-
163
-
constcall=callAgent.join(context);
164
-
157
+
RoomParticipant user1 =newRoomParticipant().setCommunicationIdentifier(newCommunicationUserIdentifier("<ACS User MRI identity 1>")).setRole(RoleType.ATTENDEE);
158
+
RoomParticipant user2 =newRoomParticipant().setCommunicationIdentifier(newCommunicationUserIdentifier("<ACS User MRI identity 2>")).setRole(RoleType.PRESENTER);
0 commit comments