Skip to content

release: 2.5.0+hotfix.3 #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
channel: 'stable'
- name: Install project dependencies
run: flutter pub get
- name: Install xcode platform support for iOS
run: xcodebuild -downloadPlatform iOS
- name: Build for iOS
working-directory: ./example
run: flutter build ios --release --no-codesign
Expand Down Expand Up @@ -170,4 +172,4 @@ jobs:
run: flutter pub get
- name: Build for Web
working-directory: ./example
run: flutter build web --wasm
run: flutter build web --wasm
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# CHANGELOG

## 2.5.0+hotfix.3

* fix: Fix @internal conflicting imports from package meta or flutter/foundation.

## 2.5.0+hotfix.2

* hotfix: bump libwebrtc to m137.7151.03 to support H.265 (#837)
* feat: Expose ParticipantState (#848)
* chore: Update protobuf to v1.39.2 (#847)

## 2.5.0+hotfix.1

* fix: Switch to livekit fork of noise for 16KB page support (#839)
* hotfix: bump libwebrtc to m137.7151.01 for android (#837)
* fix: tighten VideoTrackRenderer Widget (#695)

## 2.5.0

* Bump flutter-webrtc to 1.0.0.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
implementation 'io.github.webrtc-sdk:android:137.7151.01'
implementation 'io.github.webrtc-sdk:android:137.7151.03'
implementation 'io.livekit:noise:2.0.0'
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 15 15:44:59 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Nov 14 15:55:14 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.7.2' apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
3 changes: 2 additions & 1 deletion example/lib/pages/connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ class _ConnectPageState extends State<ConnectPage> {
'AV1',
'VP9',
'VP8',
'H264'
'H264',
'H265'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
Expand Down
2 changes: 1 addition & 1 deletion ios/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'Flutter'
s.dependency 'WebRTC-SDK', '137.7151.02'
s.dependency 'WebRTC-SDK', '137.7151.03'
s.dependency 'flutter_webrtc'
end
7 changes: 5 additions & 2 deletions lib/src/core/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

import 'dart:async';

import 'package:flutter/foundation.dart' hide internal;

import 'package:collection/collection.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
import 'package:meta/meta.dart';

Expand All @@ -34,7 +35,6 @@ import '../proto/livekit_models.pb.dart' as lk_models;
import '../proto/livekit_rtc.pb.dart' as lk_rtc;
import '../publication/local.dart';
import '../support/disposable.dart';
import '../support/platform.dart' show lkPlatformIsTest, lkPlatformIs, PlatformType;
import '../support/region_url_provider.dart';
import '../support/websocket.dart';
import '../track/local/local.dart';
Expand All @@ -44,6 +44,9 @@ import '../types/other.dart';
import 'signal_client.dart';
import 'transport.dart';

import '../support/platform.dart'
show lkPlatformIsTest, lkPlatformIs, PlatformType;

const maxRetryDelay = 7000;

const defaultRetryDelaysInMs = [
Expand Down
14 changes: 7 additions & 7 deletions lib/src/core/room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:collection/collection.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -1102,17 +1102,17 @@ extension RoomHardwareManagementMethods on Room {
final currentDeviceId =
engine.roomOptions.defaultCameraCaptureOptions.deviceId;

// Always update roomOptions so future tracks use the correct device
engine.roomOptions = engine.roomOptions.copyWith(
defaultCameraCaptureOptions: roomOptions.defaultCameraCaptureOptions
.copyWith(deviceId: device.deviceId),
);

try {
if (track != null && selectedVideoInputDeviceId != device.deviceId) {
await track.switchCamera(device.deviceId);
Hardware.instance.selectedVideoInput = device;
}

// Always update roomOptions so future tracks use the correct device
engine.roomOptions = engine.roomOptions.copyWith(
defaultCameraCaptureOptions: roomOptions.defaultCameraCaptureOptions
.copyWith(deviceId: device.deviceId),
);
} catch (e) {
// if the switching actually fails, reset it to the previous deviceId
engine.roomOptions = engine.roomOptions.copyWith(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/signal_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import 'dart:async';
import 'dart:collection';

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:fixnum/fixnum.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/data_stream/stream_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ abstract class BaseStreamReader<T extends BaseStreamInfo, U> {

BaseStreamReader(T info, DataStreamController<DataStream_Chunk> stream,
this._totalByteSize) {
this.reader = stream;
this._info = info;
reader = stream;
_info = info;
}

void handleChunkReceived(DataStream_Chunk chunk);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data_stream/stream_writer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BaseStreamWriter<T, InfoType extends BaseStreamInfo> {

Future<void> close() async {
await writableStream.close();
this.onClose?.call();
onClose?.call();
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/src/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ class ParticipantStateUpdatedEvent with RoomEvent, ParticipantEvent {

/// [Pariticpant]'s [ConnectionQuality] has updated.
/// Emitted by [Room] and [Participant].
class ParticipantConnectionQualityUpdatedEvent with RoomEvent, ParticipantEvent {
class ParticipantConnectionQualityUpdatedEvent
with RoomEvent, ParticipantEvent {
final Participant participant;
final ConnectionQuality connectionQuality;
const ParticipantConnectionQualityUpdatedEvent({
Expand Down
2 changes: 1 addition & 1 deletion lib/src/managers/broadcast_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:meta/meta.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class AudioPublishOptions extends PublishOptions {

final backupCodecs = ['vp8', 'h264'];

final videoCodecs = ['vp8', 'h264', 'vp9', 'av1'];
final videoCodecs = ['vp8', 'h264', 'h265', 'vp9', 'av1'];

bool isBackupCodec(String codec) {
return backupCodecs.contains(codec.toLowerCase());
Expand Down
2 changes: 1 addition & 1 deletion lib/src/participant/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:math';

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:async/async.dart';
import 'package:fixnum/fixnum.dart';
Expand Down
48 changes: 32 additions & 16 deletions lib/src/participant/participant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import '../utils.dart';

/// Base for [RemoteParticipant] and [LocalParticipant],
/// can not be instantiated directly.
abstract class Participant<T extends TrackPublication> extends DisposableChangeNotifier
with EventsEmittable<ParticipantEvent> {
abstract class Participant<T extends TrackPublication>
extends DisposableChangeNotifier with EventsEmittable<ParticipantEvent> {
/// Reference to [Room]
@internal
final Room room;
Expand Down Expand Up @@ -81,7 +81,8 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN
ParticipantPermissions get permissions => _permissions;

/// Attributes associated with the participant
UnmodifiableMapView<String, String> get attributes => UnmodifiableMapView(_attributes);
UnmodifiableMapView<String, String> get attributes =>
UnmodifiableMapView(_attributes);
Map<String, String> _attributes = {};

// Participant state
Expand All @@ -92,7 +93,8 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN
DateTime get joinedAt {
final pi = _participantInfo;
if (pi != null) {
return DateTime.fromMillisecondsSinceEpoch(pi.joinedAt.toInt() * 1000, isUtc: true);
return DateTime.fromMillisecondsSinceEpoch(pi.joinedAt.toInt() * 1000,
isUtc: true);
}
return DateTime.now();
}
Expand Down Expand Up @@ -191,10 +193,14 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN
}

void _setAttributes(Map<String, String> attrs) {
final diff = mapDiff(_attributes, attrs).map((k, v) => MapEntry(k as String, v as String));
final diff = mapDiff(_attributes, attrs)
.map((k, v) => MapEntry(k as String, v as String));
_attributes = attrs;
if (diff.isNotEmpty) {
[events, room.events].emit(ParticipantAttributesChanged(participant: this, attributes: diff));
[
events,
room.events
].emit(ParticipantAttributesChanged(participant: this, attributes: diff));
}
}

Expand All @@ -211,7 +217,9 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN
@internal
Future<bool> updateFromInfo(lk_models.ParticipantInfo info) async {
logger.fine('LocalParticipant.updateFromInfo(info: $info)');
if (_participantInfo != null && _participantInfo!.sid == info.sid && _participantInfo!.version > info.version) {
if (_participantInfo != null &&
_participantInfo!.sid == info.sid &&
_participantInfo!.version > info.version) {
return false;
}

Expand Down Expand Up @@ -287,14 +295,19 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN
T? getTrackPublicationBySource(TrackSource source) {
if (source == TrackSource.unknown) return null;
// try to find by source
final result = trackPublications.values.firstWhereOrNull((e) => e.source == source);
final result =
trackPublications.values.firstWhereOrNull((e) => e.source == source);
if (result != null) return result;
// try to find by compatibility
return trackPublications.values.where((e) => e.source == TrackSource.unknown).firstWhereOrNull((e) =>
(source == TrackSource.microphone && e.kind == TrackType.AUDIO) ||
(source == TrackSource.camera && e.kind == TrackType.VIDEO) ||
(source == TrackSource.screenShareVideo && e.kind == TrackType.VIDEO) ||
(source == TrackSource.screenShareAudio && e.kind == TrackType.AUDIO));
return trackPublications.values
.where((e) => e.source == TrackSource.unknown)
.firstWhereOrNull((e) =>
(source == TrackSource.microphone && e.kind == TrackType.AUDIO) ||
(source == TrackSource.camera && e.kind == TrackType.VIDEO) ||
(source == TrackSource.screenShareVideo &&
e.kind == TrackType.VIDEO) ||
(source == TrackSource.screenShareAudio &&
e.kind == TrackType.AUDIO));
}

/// Convenience property to check whether [TrackSource.camera] is published or not.
Expand All @@ -304,17 +317,20 @@ abstract class Participant<T extends TrackPublication> extends DisposableChangeN

/// Convenience property to check whether [TrackSource.microphone] is published or not.
bool isMicrophoneEnabled() {
return !(getTrackPublicationBySource(TrackSource.microphone)?.muted ?? true);
return !(getTrackPublicationBySource(TrackSource.microphone)?.muted ??
true);
}

/// Convenience property to check whether [TrackSource.screenShareVideo] is published or not.
bool isScreenShareEnabled() {
return !(getTrackPublicationBySource(TrackSource.screenShareVideo)?.muted ?? true);
return !(getTrackPublicationBySource(TrackSource.screenShareVideo)?.muted ??
true);
}

/// Convenience property to check whether [TrackSource.screenShareAudio] is published or not.
bool isScreenShareAudioEnabled() {
return !(getTrackPublicationBySource(TrackSource.screenShareAudio)?.muted ?? true);
return !(getTrackPublicationBySource(TrackSource.screenShareAudio)?.muted ??
true);
}

/// (Equality operator) [Participant.hashCode] is same as [sid.hashCode].
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/audio_visualizer.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:uuid/uuid.dart' as uuid;

import '../support/disposable.dart';
import '../events.dart' show AudioVisualizerEvent;
import '../managers/event.dart' show EventsEmittable;
import '../support/disposable.dart';
import 'local/local.dart' show AudioTrack;

import 'audio_visualizer_native.dart'
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/local/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;
import 'package:flutter/material.dart';

import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
Expand Down
3 changes: 2 additions & 1 deletion lib/src/track/local/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';

import 'package:collection/collection.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;

import '../../events.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/track/track.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
import 'package:meta/meta.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/src/types/participant_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ extension ParticipantStateExt on lk_models.ParticipantInfo_State {
lk_models.ParticipantInfo_State.JOINING => ParticipantState.joining,
lk_models.ParticipantInfo_State.JOINED => ParticipantState.joined,
lk_models.ParticipantInfo_State.ACTIVE => ParticipantState.active,
lk_models.ParticipantInfo_State.DISCONNECTED => ParticipantState.disconnected,
lk_models.ParticipantInfo_State.DISCONNECTED =>
ParticipantState.disconnected,
_ => ParticipantState.unknown,
};
}
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:math' as math;

import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart' hide internal;

import 'package:collection/collection.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
Expand Down
2 changes: 1 addition & 1 deletion macos/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'FlutterMacOS'
s.dependency 'WebRTC-SDK', '137.7151.02'
s.dependency 'WebRTC-SDK', '137.7151.03'
s.dependency 'flutter_webrtc'
end
Loading
Loading