Skip to content

Commit

Permalink
Deprecate publishOnly option (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Jul 6, 2022
1 parent 5b1c5a0 commit 40a51f5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
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

0 comments on commit 40a51f5

Please sign in to comment.