10000 Update. · lineCode/flutter-webrtc@6736f92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6736f92

Browse files
committed
Update.
1 parent c9a6e0f commit 6736f92

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

example/lib/main.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class MyApp extends StatefulWidget {
1414

1515
class _MyAppState extends State<MyApp> {
1616
List<RouteItem> items;
17-
String _ip = '192.168.31.152';
17+
String _serverAddress = '192.168.31.152';
1818
SharedPreferences prefs;
1919

2020
@override
@@ -55,7 +55,7 @@ class _MyAppState extends State<MyApp> {
5555
_initData() async {
5656
prefs = await SharedPreferences.getInstance();
5757
setState(() {
58-
_ip = prefs.getString('ip') ?? '';
58+
_serverAddress = prefs.getString('server') ?? '';
5959
});
6060
}
6161

@@ -78,31 +78,31 @@ class _MyAppState extends State<MyApp> {
7878
context: context,
7979
builder: (BuildContext context) {
8080
return SimpleDialog(
81-
title: const Text('Please input server ip'),
81+
title: const Text('Please input server address.'),
8282
children: <Widget>[
8383
TextField(
8484
onChanged: (String text) {
8585
setState(() {
86-
_ip = text;
86+
_serverAddress = text;
8787
});
8888
},
8989
decoration: InputDecoration(
90-
hintText: _ip,
90+
hintText: _serverAddress,
9191
),
9292
textAlign: TextAlign.center,
9393
),
9494
SimpleDialogOption(
9595
onPressed: () {},
9696
child: RaisedButton(
9797
onPressed: () {
98-
prefs.setString('ip', _ip);
98+
prefs.setString('server', _serverAddress);
9999
Navigator.push(
100100
context,
101101
MaterialPageRoute(
102102
builder: (BuildContext context) =>
103-
CallSample(ip: _ip)));
103+
CallSample(ip: _serverAddress)));
104104
},
105-
child: const Text('connect server'),
105+
child: const Text('Connect Server'),
106106
),
107107
),
108108
],

example/lib/src/call_sample/call_sample.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class _CallSampleState extends State<CallSample> {
8787
}
8888

8989
_invitePeer(context, peerId) {
90-
if (_signaling != null) {
90+
if (_signaling != null && peerId != _self_id) {
9191
_signaling.invite(peerId, 'video');
9292
}
9393
}
@@ -99,13 +99,13 @@ class _CallSampleState extends State<CallSample> {
9999
}
100100

101101
_buildRow(context, peer) {
102-
if(peer['id'] == _self_id)
103-
return null;
102+
var self = (peer['id'] == _self_id);
104103
return ListBody(children: <Widget>[
105104
ListTile(
106-
title: Text(peer['name']),
105+
title: Text(self? peer['name'] + '[Your self]' : peer['name']+'['+peer['user_agent']+']'),
107106
onTap: () => _invitePeer(context, peer['id']),
108107
trailing: Icon(Icons.videocam),
108+
subtitle: Text('id: '+ peer['id']),
109109
),
110110
Divider()
111111
]);

0 commit comments

Comments
 (0)
0