Skip to content

Commit

Permalink
chore: bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Feb 7, 2022
1 parent 0b9e8f0 commit 59c5122
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

--------------------------------------------
[1.0.3] - 2022-02-07

* Add restartIce.
* Bump version for webrtc-interface.

[1.0.2] - 2021-11-27

* Fix the type error of minified function in release mode.
Expand Down
6 changes: 6 additions & 0 deletions lib/src/rtc_peerconnection_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
return Future.value(RTCDataChannelWeb(jsDc));
}

@override
Future<void> restartIce() {
jsutil.callMethod(_jsPc, 'restartIce', []);
return Future.value();
}

@override
Future<void> close() async {
_jsPc.close();
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: dart_webrtc
description: Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers.
version: 1.0.2
version: 1.0.3
homepage: https://github.com/flutter-webrtc/dart-webrtc

environment:
sdk: '>=2.13.0 <3.0.0'

dependencies:
webrtc_interface: ^1.0.1
webrtc_interface: ^1.0.2

dev_dependencies:
build_runner: ^1.10.0
Expand Down
16 changes: 8 additions & 8 deletions web/p2p/signaling.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Signaling {

final JsonEncoder _encoder = JsonEncoder();
final String _selfId = randomNumeric(6);
late SimpleWebSocket _socket;
late SimpleWebSocket? _socket;
var _sessionId;
final _host;
final _port = 8086;
Expand Down Expand Up @@ -63,7 +63,7 @@ class Signaling {
_peerConnections.forEach((key, pc) {
pc.close();
});
if (_socket != null) _socket.close();
_socket?.close();
}

void switchCamera() {
Expand Down Expand Up @@ -228,25 +228,25 @@ class Signaling {
}
}

_socket.onOpen = () {
_socket?.onOpen = () {
print('onOpen');
onStateChange?.call(SignalingState.ConnectionOpen);
_send('new',
{'name': 'dart_webrtc', 'id': _selfId, 'user_agent': 'broswer'});
};

_socket.onMessage = (message) {
_socket?.onMessage = (message) {
print('Received data: ' + message);
var decoder = JsonDecoder();
onMessage.call(decoder.convert(message));
};

_socket.onClose = (int code, String reason) {
_socket?.onClose = (int code, String reason) {
print('Closed by server [$code => $reason]!');
onStateChange?.call(SignalingState.ConnectionClosed);
};

await _socket.connect();
await _socket?.connect();
}

Future<MediaStream> createStream(media, user_screen) async {
Expand Down Expand Up @@ -291,7 +291,7 @@ class Signaling {
'to': id,
'from': _selfId,
'candidate': {
'sdpMLineIndex': candidate.sdpMlineIndex,
'sdpMLineIndex': candidate.sdpMLineIndex,
'sdpMid': candidate.sdpMid,
'candidate': candidate.candidate,
},
Expand Down Expand Up @@ -377,6 +377,6 @@ class Signaling {
var request = {};
request['type'] = event;
request['data'] = data;
_socket.send(_encoder.convert(request));
_socket?.send(_encoder.convert(request));
}
}
2 changes: 0 additions & 2 deletions web/test_peerconnection.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:html';

import 'package:dart_webrtc/dart_webrtc.dart';
import 'package:test/test.dart';

Expand Down

0 comments on commit 59c5122

Please sign in to comment.