From f005ed354bdfdbda589e1359b4704104e0d2c1d2 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 1 Oct 2021 10:30:01 -0700 Subject: [PATCH 1/4] pass SDK and version number to server, v0.5.0 --- CHANGELOG.md | 10 ++++++++++ example/pubspec.lock | 4 ++-- lib/src/utils.dart | 14 +++++++++++--- pubspec.lock | 2 +- pubspec.yaml | 8 ++++---- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6956818e..b9d50679d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGELOG +## 0.5.0 + +* major update with new event system +* supports simulcast for iOS +* support for background audio for iOS +* support for protocol 3, subscriber as primary connection +* improved audio management for iOS, mic indicator only when audio tracks published +* fires TrackUnpublished for local tracks +* fixed occasional crashes during publishing + ## 0.4.1 * fixed video rendering blank after widget changes diff --git a/example/pubspec.lock b/example/pubspec.lock index 43fbf463d..3c7da11fb 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -113,7 +113,7 @@ packages: name: flutter_webrtc url: "https://pub.dartlang.org" source: hosted - version: "0.6.9" + version: "0.6.10" google_fonts: dependency: "direct main" description: @@ -155,7 +155,7 @@ packages: path: ".." relative: true source: path - version: "0.4.1" + version: "0.5.0" logging: dependency: "direct main" description: diff --git a/lib/src/utils.dart b/lib/src/utils.dart index f5aae382b..077b1d93b 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -6,6 +6,7 @@ import 'extensions.dart'; import 'options.dart'; import 'track/options.dart'; import 'types.dart'; +import 'version.dart'; extension UriExt on Uri { bool get isSecureScheme => ['https', 'wss'].contains(scheme); @@ -33,9 +34,12 @@ class Utils { path: validate ? 'validate' : 'rtc', queryParameters: { 'access_token': token, - if (options != null) 'auto_subscribe': options.autoSubscribe ? '1' : '0', + if (options != null) + 'auto_subscribe': options.autoSubscribe ? '1' : '0', if (reconnect) 'reconnect': '1', 'protocol': protocol.toStringValue(), + 'sdk': 'flutter', + 'version': clientVersion, }, ); } @@ -45,7 +49,9 @@ class Utils { int height, ) { final double aspect = width / height; - if ((aspect - 16.0 / 9.0).abs() < (aspect - 4.0 / 3.0).abs()) return VideoParameters.presets169; + if ((aspect - 16.0 / 9.0).abs() < (aspect - 4.0 / 3.0).abs()) { + return VideoParameters.presets169; + } return VideoParameters.presets43; } @@ -72,7 +78,9 @@ class Utils { VideoEncoding? videoEncoding = options.videoEncoding; - if ((videoEncoding == null && !options.simulcast) || width == null || height == null) { + if ((videoEncoding == null && !options.simulcast) || + width == null || + height == null) { // don't set encoding when we are not simulcasting and user isn't restricting // encoding parameters return null; diff --git a/pubspec.lock b/pubspec.lock index 2b5752380..4a9fef324 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -101,7 +101,7 @@ packages: name: flutter_webrtc url: "https://pub.dartlang.org" source: hosted - version: "0.6.9" + version: "0.6.10" http: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e3064b950..871d67af2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: livekit_client description: Flutter Client SDK for LiveKit -version: 0.4.1 +version: 0.5.0 homepage: https://livekit.io environment: @@ -10,13 +10,13 @@ environment: dependencies: flutter: sdk: flutter - + http: ^0.13.3 logging: ^1.0.2 uuid: ^3.0.4 synchronized: ^3.0.0 - protobuf: ^2.0.0 - flutter_webrtc: ^0.6.9 + protobuf: ^2.0.0 + flutter_webrtc: ^0.6.10 dev_dependencies: flutter_test: From 7bd527f6255e42620fc84eb8d910eae0de68d0fb Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 1 Oct 2021 10:37:39 -0700 Subject: [PATCH 2/4] missing files and formatting --- lib/src/utils.dart | 7 ++----- lib/src/version.dart | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 lib/src/version.dart diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 077b1d93b..989ea7331 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -34,8 +34,7 @@ class Utils { path: validate ? 'validate' : 'rtc', queryParameters: { 'access_token': token, - if (options != null) - 'auto_subscribe': options.autoSubscribe ? '1' : '0', + if (options != null) 'auto_subscribe': options.autoSubscribe ? '1' : '0', if (reconnect) 'reconnect': '1', 'protocol': protocol.toStringValue(), 'sdk': 'flutter', @@ -78,9 +77,7 @@ class Utils { VideoEncoding? videoEncoding = options.videoEncoding; - if ((videoEncoding == null && !options.simulcast) || - width == null || - height == null) { + if ((videoEncoding == null && !options.simulcast) || width == null || height == null) { // don't set encoding when we are not simulcasting and user isn't restricting // encoding parameters return null; diff --git a/lib/src/version.dart b/lib/src/version.dart new file mode 100644 index 000000000..f3539277a --- /dev/null +++ b/lib/src/version.dart @@ -0,0 +1 @@ +const clientVersion = '0.5.0'; From 7662982afc49370c0655fbe20f06ee16598649a0 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 1 Oct 2021 10:38:09 -0700 Subject: [PATCH 3/4] make format --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7007e2376..04a62e842 100644 --- a/Makefile +++ b/Makefile @@ -10,4 +10,7 @@ proto: fi \ } -.PHONY: proto +format: + flutter format --set-exit-if-changed -l 100 . + +.PHONY: proto format From b2f6f6f08979bc7d3c917319dc21c5be75cdd6b2 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 1 Oct 2021 10:53:46 -0700 Subject: [PATCH 4/4] line length comment for VSCode --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index b312869cf..3d33a40cb 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,19 @@ These controls are accessible on the `RemoteTrackPublication` object. For more info, see [Subscriber controls](https://docs.livekit.io/guides/room/receive#subscriber-controls). +## Development + +The project is configured to lint with line length of 100. If using VS Code, set the following in your `settings.json` + +```json +"dart.lineLength": 100, +"[dart]": { + "editor.rulers": [ + 100 + ] +} +``` + ## License Apache License 2.0