File tree 1 file changed +20
-5
lines changed
1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -116,18 +116,33 @@ class _DeviceEnumerationSampleState extends State<DeviceEnumerationSample> {
116
116
117
117
Future <void > _negotiate () async {
118
118
try {
119
- final offer = await pc! .createOffer ();
119
+ Map <String , dynamic > buildConstraints () {
120
+ if (kIsWeb) {
121
+ return {
122
+ 'offerToReceiveAudio' : true ,
123
+ 'offerToReceiveVideo' : true ,
124
+ };
125
+ } else {
126
+ return {};
127
+ }
128
+ }
129
+
130
+ final offer = await pc! .createOffer (buildConstraints ());
131
+
120
132
await pc! .setLocalDescription (offer);
121
133
122
134
final response = await dio.postUri <Map <String , dynamic >>(
123
135
Uri .https (
124
136
'preprod-smartdevicemanagement.googleapis.com' ,
125
137
'/v1/enterprises/$enterpriseId /devices/$deviceId :executeCommand' ,
126
138
),
127
- options: Options (headers: {
128
- 'Authorization' : 'Bearer $jwt ' ,
129
- 'X-SDM-ID-Token' : sdmIdToken,
130
- }),
139
+ options: Options (
140
+ headers: {
141
+ 'Authorization' : 'Bearer $jwt ' ,
142
+ 'X-SDM-ID-Token' : sdmIdToken,
143
+ },
144
+ contentType: Headers .jsonContentType,
145
+ ),
131
146
data: < String , dynamic > {
132
147
'command' :
133
148
'sdm.devices.commands.CameraLiveStreamWithTalkBack.GenerateWebRtcStream' ,
You can’t perform that action at this time.
0 commit comments