File tree 13 files changed +70
-24
lines changed
13 files changed +70
-24
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 2.4.5
4
+
5
+ * feat: noise filter for flutter web. (#762 )
6
+
3
7
## 2.4.4
4
8
5
9
* feat: data stream
Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = 'livekit_client'
3
- s . version = '2.4.4 '
3
+ s . version = '2.4.5 '
4
4
s . summary = 'Open source platform for real-time audio and video.'
5
5
s . description = 'Open source platform for real-time audio and video.'
6
6
s . homepage = 'https://livekit.io/'
Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ export 'src/track/remote/audio.dart';
44
44
export 'src/track/remote/remote.dart' ;
45
45
export 'src/track/remote/video.dart' ;
46
46
export 'src/track/track.dart' ;
47
+
47
48
export 'src/track/processor.dart' ;
49
+ export 'src/track/processor_native.dart'
50
+ if (dart.library.js_interop) 'src/track/processor_web.dart' ;
51
+
48
52
export 'src/track/audio_visualizer.dart' ;
49
53
export 'src/types/other.dart' ;
50
54
export 'src/types/participant_permissions.dart' ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import 'support/native.dart';
20
20
/// Main entry point to connect to a room.
21
21
/// {@category Room}
22
22
class LiveKitClient {
23
- static const version = '2.4.4 ' ;
23
+ static const version = '2.4.5 ' ;
24
24
25
25
/// Initialize the WebRTC plugin. If this is not manually called, will be
26
26
/// initialized with default settings.
Original file line number Diff line number Diff line change 14
14
15
15
import 'dart:io' ;
16
16
17
+ import 'package:flutter/foundation.dart' ;
18
+
17
19
import '../platform.dart' ;
18
20
19
21
PlatformType lkPlatformImplementation () {
@@ -31,7 +33,7 @@ bool lkPlatformIsWebMobileImplementation() {
31
33
}
32
34
33
35
bool lkPlatformIsTestImplementation () =>
34
- Platform .environment.containsKey ('FLUTTER_TEST' );
36
+ ! kIsWeb && ! kIsWasm && Platform .environment.containsKey ('FLUTTER_TEST' );
35
37
36
38
bool lkE2EESupportedImplementation () {
37
39
return [
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ import '../track.dart';
36
36
import 'audio.dart' ;
37
37
import 'video.dart' ;
38
38
39
+ import '../processor_native.dart'
40
+ if (dart.library.js_interop) '../processor_web.dart' ;
41
+
39
42
/// Used to group [LocalVideoTrack] and [RemoteVideoTrack] .
40
43
mixin VideoTrack on Track {
41
44
@internal
@@ -258,13 +261,16 @@ abstract class LocalTrack extends Track {
258
261
259
262
_processor = processor;
260
263
261
- var processorOptions = ProcessorOptions (
262
- kind: kind,
264
+ var processorOptions = AudioProcessorOptions (
263
265
track: mediaStreamTrack,
264
266
);
265
267
266
268
await _processor! .init (processorOptions);
267
269
270
+ if (_processor? .processedTrack != null ) {
271
+ setProcessedTrack (processor.processedTrack! );
272
+ }
273
+
268
274
logger.fine ('processor initialized' );
269
275
270
276
events.emit (TrackProcessorUpdateEvent (track: this , processor: _processor));
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ import '../track/local/video.dart';
21
21
import '../types/video_parameters.dart' ;
22
22
import 'processor.dart' ;
23
23
24
+ import 'processor_native.dart'
25
+ if (dart.library.js_interop) 'processor_web.dart' ;
26
+
24
27
/// A type that represents front or back of the camera.
25
28
enum CameraPosition {
26
29
front,
Original file line number Diff line number Diff line change @@ -12,18 +12,6 @@ class ProcessorOptions<T extends TrackType> {
12
12
});
13
13
}
14
14
15
- class AudioProcessorOptions extends ProcessorOptions {
16
- AudioProcessorOptions ({
17
- required MediaStreamTrack track,
18
- }) : super (kind: TrackType .AUDIO , track: track);
19
- }
20
-
21
- class VideoProcessorOptions extends ProcessorOptions {
22
- VideoProcessorOptions ({
23
- required MediaStreamTrack track,
24
- }) : super (kind: TrackType .VIDEO , track: track);
25
- }
26
-
27
15
abstract class TrackProcessor <T extends ProcessorOptions > {
28
16
String get name;
29
17
@@ -36,4 +24,6 @@ abstract class TrackProcessor<T extends ProcessorOptions> {
36
24
Future <void > onPublish (Room room);
37
25
38
26
Future <void > onUnpublish ();
27
+
28
+ MediaStreamTrack ? get processedTrack;
39
29
}
Original file line number Diff line number Diff line change
1
+ import 'package:flutter_webrtc/flutter_webrtc.dart' ;
2
+
3
+ import '../types/other.dart' ;
4
+ import 'processor.dart' ;
5
+
6
+ class AudioProcessorOptions extends ProcessorOptions {
7
+ AudioProcessorOptions ({
8
+ required MediaStreamTrack track,
9
+ }) : super (kind: TrackType .AUDIO , track: track);
10
+ }
11
+
12
+ class VideoProcessorOptions extends ProcessorOptions {
13
+ VideoProcessorOptions ({
14
+ required MediaStreamTrack track,
15
+ }) : super (kind: TrackType .VIDEO , track: track);
16
+ }
Original file line number Diff line number Diff line change 1
- import 'package:web/web.dart' ;
1
+ import 'package:flutter_webrtc/flutter_webrtc.dart' show MediaStreamTrack;
2
+ import 'package:web/web.dart' show AudioContext, HTMLAudioElement;
2
3
4
+ import '../types/other.dart' ;
3
5
import 'processor.dart' ;
4
6
5
- class AudioProcessorOptionsWeb extends AudioProcessorOptions {
6
- AudioProcessorOptionsWeb ({
7
+ class AudioProcessorOptions extends ProcessorOptions {
8
+ AudioProcessorOptions ({
9
+ required MediaStreamTrack track,
7
10
this .audioElement,
8
11
this .audioContext,
9
- required super .track,
10
- });
12
+ }) : super (kind: TrackType .AUDIO , track: track);
11
13
12
14
HTMLAudioElement ? audioElement;
13
15
AudioContext ? audioContext;
14
16
}
17
+
18
+ class VideoProcessorOptions extends ProcessorOptions {
19
+ VideoProcessorOptions ({
20
+ required MediaStreamTrack track,
21
+ }) : super (kind: TrackType .VIDEO , track: track);
22
+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ abstract class Track extends DisposableChangeNotifier
46
46
rtc.MediaStreamTrack get mediaStreamTrack => _mediaStreamTrack;
47
47
rtc.MediaStreamTrack _mediaStreamTrack;
48
48
49
+ rtc.MediaStreamTrack ? _originalTrack;
50
+
49
51
String ? sid;
50
52
rtc.RTCRtpTransceiver ? transceiver;
51
53
String ? _cid;
@@ -137,6 +139,11 @@ abstract class Track extends DisposableChangeNotifier
137
139
await mediaStreamTrack.stop ();
138
140
}
139
141
142
+ if (_originalTrack != null ) {
143
+ await _originalTrack? .stop ();
144
+ _originalTrack = null ;
145
+ }
146
+
140
147
_active = false ;
141
148
return true ;
142
149
}
@@ -220,4 +227,10 @@ abstract class Track extends DisposableChangeNotifier
220
227
stream: stream,
221
228
));
222
229
}
230
+
231
+ @internal
232
+ void setProcessedTrack (rtc.MediaStreamTrack track) {
233
+ _originalTrack = _mediaStreamTrack;
234
+ _mediaStreamTrack = track;
235
+ }
223
236
}
Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
s . name = 'livekit_client'
3
- s . version = '2.4.4 '
3
+ s . version = '2.4.5 '
4
4
s . summary = 'Open source platform for real-time audio and video.'
5
5
s . description = 'Open source platform for real-time audio and video.'
6
6
s . homepage = 'https://livekit.io/'
Original file line number Diff line number Diff line change 15
15
name : livekit_client
16
16
description : Flutter Client SDK for LiveKit.
17
17
Build real-time video and audio into your apps. Supports iOS, Android, and Web.
18
- version : 2.4.4
18
+ version : 2.4.5
19
19
homepage : https://github.com/livekit/client-sdk-flutter
20
20
21
21
environment :
You can’t perform that action at this time.
0 commit comments