Skip to content

feat(room): add --track-name flag to lk room join - #958

Open
Scorpion197 wants to merge 1 commit into
livekit:mainfrom
Scorpion197:feat/join-track-name
Open

feat(room): add --track-name flag to lk room join#958
Scorpion197 wants to merge 1 commit into
livekit:mainfrom
Scorpion197:feat/join-track-name

Conversation

@Scorpion197

Copy link
Copy Markdown

Resolves #669

What

Adds a --track-name flag to lk room join that sets the name of tracks published via --publish.

Why

Previously there was no way to name a published track: file tracks were named after the file path, and socket publishes (e.g. h264://127.0.0.1:5004) produced tracks with an empty name, making them hard for subscriber clients to identify (see #669).

How

  • New --track-name flag on lk room join, threaded through handlePublishpublishFile / publishSocket / publishReader, and through handleSimulcastPublish so the flag also applies in simulcast mode.
  • Extracted a small trackPublicationOptions helper that prefers the override over the per-source default; defaults are unchanged (file name for files, unnamed for sockets, simulcast for simulcast).
  • Unit test TestTrackPublicationOptions covers the naming logic.

Testing

  • go test ./... passes; gofmt/go vet clean.
  • Verified end-to-end against livekit-server --dev:
    • --publish change-amelia.ogg --track-name my-custom-audiopublished track {"name": "my-custom-audio"}
    • without the flag → published track {"name": ".../change-amelia.ogg"} (unchanged default)

@CLAassistant

CLAassistant commented Sep 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Tracks published via --publish previously had no way to set a name:
file tracks were named after the file and socket tracks were unnamed,
making them hard for subscribers to identify.

Add a --track-name flag that overrides the published track name for
file, socket, and simulcast publishes. Defaults are unchanged.

Resolves livekit#669
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.

lk cli: Add arg to set a track name

2 participants