Skip to content

Priorities for published and subscribed tracks #259

@lukasIO

Description

@lukasIO

It'd be a very flexible approach to be able to manually set priorities for tracks. A (non-default) priority could influence the stream allocation based on the application needs by (de-)prioritizing specific tracks, making sure the bandwidth needs for the ones marked with higher priority are satisfied first.

It could be a hint for published tracks

const pub = await room.localParticipant.publishTrack(mediaStreamTrack, {
  name: 'mytrack',
  priority: 2
})

but in the best case scenario also for subscriptions

function handleTrackSubscribed(
  track: RemoteTrack,
  publication: RemoteTrackPublication,
  participant: RemoteParticipant
) {
  if (track.kind === Track.Kind.Video) {
    publication.setPriority(2)
  }
}

Common application examples I can think of:

  • prioritizing all audio tracks over video tracks (or vice versa)
  • prioritizing screen share tracks over regular video tracks
  • prioritizing certain video (and audio) tracks of participants on a "stage"

I'm not sure if this would be in any way connected to the work going on around the stream allocator (e.g. #257).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions