Skip to content
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

Allow manual operation on audio publications even with adaptiveStream enabled #634

Merged
merged 2 commits into from
Mar 30, 2023
Merged
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
5 changes: 5 additions & 0 deletions .changeset/polite-eels-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Allow manual operation on audio publications with adaptiveStream enabled
6 changes: 3 additions & 3 deletions src/room/track/RemoteTrackPublication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UpdateSubscription, UpdateTrackSettings } from '../../proto/livekit_rtc
import { TrackEvent } from '../events';
import type RemoteTrack from './RemoteTrack';
import RemoteVideoTrack from './RemoteVideoTrack';
import type { Track } from './Track';
import { Track } from './Track';
import { TrackPublication } from './TrackPublication';

export default class RemoteTrackPublication extends TrackPublication {
Expand Down Expand Up @@ -238,8 +238,8 @@ export default class RemoteTrackPublication extends TrackPublication {
}

private isManualOperationAllowed(): boolean {
if (this.isAdaptiveStream) {
log.warn('adaptive stream is enabled, cannot change track settings', {
if (this.kind === Track.Kind.Video && this.isAdaptiveStream) {
log.warn('adaptive stream is enabled, cannot change video track settings', {
trackSid: this.trackSid,
});
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

On a different note, should there an adpativeStream mode which includes audio also? I guess it can get confusing. I was thinking a participant level adaptiveStream. If any of the video tile of a participant is visible (camera or screen share), audio is also enabled. If none are visible, audio also disabled in this mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might make sense for a narrow set of use cases, but also wondering if it's worth the mental overhead to reason about different adaptiveStream modes to support it.
FWIW, the adaptiveStream setting already can be passed in as a config object, so it's not too far fetched to think about adaptiveStream: { includeAudio: true } or something along those lines

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it will increase cognitive load. Don't think it is worth it.

Expand Down