Skip to content

Commit 23c2595

Browse files
mikaelwillsMikael Wills
andauthored
Hold and video upgrade fixed (#503)
Co-authored-by: Mikael Wills <[email protected]>
1 parent ea69ae6 commit 23c2595

File tree

5 files changed

+222
-72
lines changed

5 files changed

+222
-72
lines changed

example/lib/src/callscreen.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ class _MyCallScreenWidget extends State<CallScreenWidget>
181181
if (_localRenderer != null) {
182182
_localRenderer!.srcObject = stream;
183183
}
184-
if (!kIsWeb && !WebRTC.platformIsDesktop) {
184+
185+
if (!kIsWeb &&
186+
!WebRTC.platformIsDesktop &&
187+
event.stream?.getAudioTracks().isNotEmpty == true) {
185188
event.stream?.getAudioTracks().first.enableSpeakerphone(false);
186189
}
187190
_localStream = stream;
@@ -334,10 +337,14 @@ class _MyCallScreenWidget extends State<CallScreenWidget>
334337
call!.voiceOnly = false;
335338
});
336339
helper!.renegotiate(
337-
call: call!, voiceOnly: false, done: (incomingMessage) {});
340+
call: call!,
341+
voiceOnly: false,
342+
done: (IncomingMessage? incomingMessage) {});
338343
} else {
339344
helper!.renegotiate(
340-
call: call!, voiceOnly: true, done: (incomingMessage) {});
345+
call: call!,
346+
voiceOnly: true,
347+
done: (IncomingMessage? incomingMessage) {});
341348
}
342349
}
343350

example/lib/src/register.dart

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,27 @@ class _MyRegisterWidget extends State<RegisterWidget>
156156
appBar: AppBar(
157157
title: Text("SIP Account"),
158158
),
159+
bottomNavigationBar: Padding(
160+
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
161+
child: Column(
162+
mainAxisSize: MainAxisSize.min,
163+
children: [
164+
Row(
165+
children: [
166+
Expanded(
167+
child: SizedBox(
168+
height: 40,
169+
child: ElevatedButton(
170+
child: Text('Register'),
171+
onPressed: () => _handleSave(context),
172+
),
173+
),
174+
),
175+
],
176+
),
177+
],
178+
),
179+
),
159180
body: ListView(
160181
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
161182
children: <Widget>[
@@ -281,11 +302,6 @@ class _MyRegisterWidget extends State<RegisterWidget>
281302
],
282303
),
283304
],
284-
const SizedBox(height: 20),
285-
ElevatedButton(
286-
child: Text('Register'),
287-
onPressed: () => _handleSave(context),
288-
),
289305
],
290306
),
291307
);

example/test/widget_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:dart_sip_ua_example/main.dart';
1313
void main() {
1414
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
1515
// Build our app and trigger a frame.
16-
await tester.pumpWidget(const MyApp());
16+
await tester.pumpWidget(MyApp());
1717

1818
// Verify that our counter starts at 0.
1919
expect(find.text('0'), findsOneWidget);

0 commit comments

Comments
 (0)