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

Deprecate publishOnly option #310

Merged
merged 1 commit into from
Jul 6, 2022
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/spotty-dragons-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': minor
---

Deprecate publishOnly connect option
4 changes: 0 additions & 4 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ <h2>Livekit Sample App</h2>
<input type="checkbox" class="form-check-input" id="force-turn" />
<label for="force-turn" class="form-check-label"> Force TURN </label>
</div>
<div>
<input type="checkbox" class="form-check-input" id="publish-only" />
<label for="publish-only" class="form-check-label"> PublishOnly </label>
</div>
<div>
<select id="preferred-codec" class="custom-select" style="width: auto">
<option value="" selected>PreferredCodec</option>
Expand Down
4 changes: 1 addition & 3 deletions example/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const appActions = {
const dynacast = (<HTMLInputElement>$('dynacast')).checked;
const forceTURN = (<HTMLInputElement>$('force-turn')).checked;
const adaptiveStream = (<HTMLInputElement>$('adaptive-stream')).checked;
const publishOnly = (<HTMLInputElement>$('publish-only')).checked;
const shouldPublish = (<HTMLInputElement>$('publish-option')).checked;
const preferredCodec = (<HTMLSelectElement>$('preferred-codec')).value as VideoCodec;

Expand All @@ -78,8 +77,7 @@ const appActions = {
};

const connectOpts: RoomConnectOptions = {
autoSubscribe: !publishOnly,
publishOnly: publishOnly ? 'publish_only' : undefined,
autoSubscribe: true,
};
if (forceTURN) {
connectOpts.rtcConfig = {
Expand Down
2 changes: 2 additions & 0 deletions src/api/SignalClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface ConnectOpts {
/** internal */
reconnect?: boolean;

/** @deprecated */
publishOnly?: string;

adaptiveStream?: boolean;
Expand All @@ -45,6 +46,7 @@ interface ConnectOpts {
// public options
export interface SignalOptions {
autoSubscribe?: boolean;
/** @deprecated */
publishOnly?: string;
adaptiveStream?: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface RoomConnectOptions {
rtcConfig?: RTCConfiguration;

/**
* @deprecated
* publish only mode
*/
publishOnly?: string;
Expand Down