Skip to content

Conversation

@Linquas
Copy link
Contributor

@Linquas Linquas commented Jan 6, 2026

Problem

While using the Flutter SDK with JS SDK and with E2EE enabled, the video from Web can not be decrypted by the Flutter app.

Summary

Enables end-to-end encryption (E2EE) for VP9 codec. Previously, E2EE was skipped for all SVC codecs. This aligns the Flutter SDK with the JS SDK, where E2EE works with VP9 codec.

Changes

Removed isSVCCodec() and use isAV1Codec() to enable E2EE setup for VP9 codec in LocalTrackPublishedEvent handler
Removed isSVCCodec() and use isAV1Codec() to enable E2EE setup for VP9 codec in TrackSubscribedEvent handler

Is there any specific reason why E2EE is disabled for SVC codecs?
I tried VP9 with this patch and the VP9 video from Web can be decrypted by Flutter app.

@CLAassistant
Copy link

CLAassistant commented Jan 6, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reliability, please enable VP9 only in this PR since AV1 is marked as not yet supported in the JS SDK.
https://github.com/livekit/client-sdk-js/blob/main/src/e2ee/worker/FrameCryptor.ts#L669-L671

@Linquas Linquas changed the title fix: Enable E2EE for SVC codec fix: Enable E2EE for VP9 codec Jan 7, 2026
@Linquas
Copy link
Contributor Author

Linquas commented Jan 7, 2026

Thanks for the input. I have updated the PR to enable E2EE for VP9 only. Please check again.

@Linquas Linquas requested a review from cloudwebrtc January 7, 2026 07:09
..on<TrackSubscribedEvent>((event) async {
final codec = event.publication.mimeType.split('/')[1];
if (event.publication.encryptionType == EncryptionType.kNone || isSVCCodec(codec)) {
if (event.publication.encryptionType == EncryptionType.kNone) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (event.publication.encryptionType == EncryptionType.kNone) {
if (event.publication.encryptionType == EncryptionType.kNone || codec.toLowerCase() == 'av1') {

..on<LocalTrackPublishedEvent>((event) async {
if (event.publication.encryptionType == EncryptionType.kNone ||
isSVCCodec(event.publication.track?.codec ?? '')) {
if (event.publication.encryptionType == EncryptionType.kNone) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (event.publication.encryptionType == EncryptionType.kNone) {
if (event.publication.encryptionType == EncryptionType.kNone ||
event.publication.track?.codec?.toLowerCase() == 'av1') {

@cloudwebrtc cloudwebrtc merged commit b835995 into livekit:main Jan 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants