Skip to content

Commit

Permalink
no need to setup frame cryptor if encryptionType is None.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Sep 15, 2023
1 parent 6dca06c commit c446842
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/src/e2ee/e2ee_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';

import '../core/room.dart';
import '../e2ee/events.dart';
import '../e2ee/options.dart';
import '../events.dart';
import '../extensions.dart';
import '../managers/event.dart';
Expand All @@ -39,6 +40,10 @@ class E2EEManager {
_listener = _room!.createListener();
_listener!
..on<LocalTrackPublishedEvent>((event) async {
if (event.publication.encryptionType == EncryptionType.kNone) {
// no need to setup frame cryptor
return;
}
var frameCryptor = await _addRtpSender(
sender: event.publication.track!.sender!,
identity: event.participant.identity,
Expand Down Expand Up @@ -71,6 +76,10 @@ class E2EEManager {
}
})
..on<TrackSubscribedEvent>((event) async {
if (event.publication.encryptionType == EncryptionType.kNone) {
// no need to setup frame cryptor
return;
}
var frameCryptor = await _addRtpReceiver(
receiver: event.track.receiver!,
identity: event.participant.identity,
Expand Down

0 comments on commit c446842

Please sign in to comment.