Skip to content

Commit

Permalink
release: 1.1.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Aug 14, 2023
1 parent c3b95f9 commit b0ce589
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

--------------------------------------------
[1.1.2] - 2023-08-14

* Add async functions for get pc states.

[1.1.1] - 2023-06-29

* downgrade collection to ^1.17.1.
Expand Down
5 changes: 5 additions & 0 deletions lib/src/media_stream_track_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ class MediaStreamTrackWeb extends MediaStreamTrack {
Future<void> setTorch(bool torch) {
throw UnimplementedError('The web implementation does not support torch');
}

@override
Future<MediaStreamTrack> clone() async {
return MediaStreamTrackWeb(jsTrack.clone());
}
}
57 changes: 57 additions & 0 deletions lib/src/rtc_peerconnection_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,72 @@ class RTCPeerConnectionWeb extends RTCPeerConnection {
@override
RTCSignalingState? get signalingState => _signalingState;

@override
Future<RTCSignalingState?> getSignalingState() async {
_signalingState = signalingStateForString(_jsPc.signalingState);
return signalingState;
}

@override
RTCIceGatheringState? get iceGatheringState => _iceGatheringState;

@override
Future<RTCIceGatheringState?> getIceGatheringState() async {
_iceGatheringState = iceGatheringStateforString(_jsPc.iceGatheringState);
return _iceGatheringState;
}

@override
RTCIceConnectionState? get iceConnectionState => _iceConnectionState;

@override
Future<RTCIceConnectionState?> getIceConnectionState() async {
_iceConnectionState = iceConnectionStateForString(_jsPc.iceConnectionState);
if (browser.isFirefox) {
switch (_iceConnectionState!) {
case RTCIceConnectionState.RTCIceConnectionStateNew:
_connectionState = RTCPeerConnectionState.RTCPeerConnectionStateNew;
break;
case RTCIceConnectionState.RTCIceConnectionStateChecking:
_connectionState =
RTCPeerConnectionState.RTCPeerConnectionStateConnecting;
break;
case RTCIceConnectionState.RTCIceConnectionStateConnected:
_connectionState =
RTCPeerConnectionState.RTCPeerConnectionStateConnected;
break;
case RTCIceConnectionState.RTCIceConnectionStateFailed:
_connectionState =
RTCPeerConnectionState.RTCPeerConnectionStateFailed;
break;
case RTCIceConnectionState.RTCIceConnectionStateDisconnected:
_connectionState =
RTCPeerConnectionState.RTCPeerConnectionStateDisconnected;
break;
case RTCIceConnectionState.RTCIceConnectionStateClosed:
_connectionState =
RTCPeerConnectionState.RTCPeerConnectionStateClosed;
break;
default:
break;
}
}
return _iceConnectionState;
}

@override
RTCPeerConnectionState? get connectionState => _connectionState;

@override
Future<RTCPeerConnectionState?> getConnectionState() async {
if (browser.isFirefox) {
await getIceConnectionState();
} else {
_connectionState = peerConnectionStateForString(_jsPc.connectionState);
}
return _connectionState;
}

@override
Future<void> dispose() {
_jsPc.close();
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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.1.1
version: 1.1.2
homepage: https://github.com/flutter-webrtc/dart-webrtc

environment:
Expand All @@ -10,7 +10,7 @@ dependencies:
collection: ^1.17.1
js: ^0.6.4
platform_detect: ^2.0.7
webrtc_interface: 1.1.0
webrtc_interface: 1.1.1

dev_dependencies:
build_runner: ^2.3.3
Expand Down

0 comments on commit b0ce589

Please sign in to comment.