Skip to content

Conversation

@hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Sep 24, 2021

Known issues

  • Background mode not working
  • Mic not turning on with record category.

Fix

  • Disposing throws exception if already published (fix unpublish logic)

@hiroshihorie hiroshihorie marked this pull request as ready for review September 28, 2021 17:25
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

looks good! I noticed how it fixed a few of the bugs that I had ran into as well.

Only Q about audio track options.

<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
Copy link
Member

Choose a reason for hiding this comment

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

do we need these? it seems like audio is the only mode we should have.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed! was figuring out why background audio wasnt working.

import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:livekit_client/src/track/audio_track.dart';
Copy link
Member

Choose a reason for hiding this comment

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

seems like an unused import

}

// doesn't make sense to negotiate if already disposed
if (!isDisposed) {
Copy link
Member

Choose a reason for hiding this comment

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

can this logic be encapsulated within engine.negotiate?

Copy link
Member Author

Choose a reason for hiding this comment

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

currently engine gets disposed later ..... so I might need to restructure things...

Copy link
Member

Choose a reason for hiding this comment

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

got it, this is fine then :)

abstract class Participant extends LKChangeNotifier {
abstract class Participant extends DisposeAwareChangeNotifier {
/// map of track sid => published track
final trackPublications = <String, TrackPublication>{};
Copy link
Member

Choose a reason for hiding this comment

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

why was this changed to a Set? IIRC, Set makes it hard to do get publication by sid. Though we don't expect the performance to be an issue.. just curious on the choice to change it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I was going to revert this 😅 lookup is harder.

@hiroshihorie
Copy link
Member Author

Background audio now works

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

great stuff! are we good to merge then? oh, it'd be great to clean up some of the lines that are commented out too.

}

// doesn't make sense to negotiate if already disposed
if (!isDisposed) {
Copy link
Member

Choose a reason for hiding this comment

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

got it, this is fine then :)

@hiroshihorie
Copy link
Member Author

great stuff! are we good to merge then? oh, it'd be great to clean up some of the lines that are commented out too.

I'll merge today after clean ups and checks!

@hiroshihorie hiroshihorie merged commit 001f688 into livekit:main Sep 30, 2021
@hiroshihorie hiroshihorie deleted the manage-audio-session branch September 30, 2021 17:47
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.

2 participants