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

Add autosubscribe checkbox for sample #542

Merged
merged 3 commits into from
Dec 28, 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/violet-toys-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Add autosubscribe option for sample
4 changes: 4 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ <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="auto-subscribe" checked/>
<label for="auto-subscribe" class="form-check-label"> Auto Subscribe </label>
</div>
<div>
<select id="preferred-codec" class="custom-select" style="width: auto">
<option value="" selected>PreferredCodec</option>
Expand Down
3 changes: 2 additions & 1 deletion example/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const appActions = {
const adaptiveStream = (<HTMLInputElement>$('adaptive-stream')).checked;
const shouldPublish = (<HTMLInputElement>$('publish-option')).checked;
const preferredCodec = (<HTMLSelectElement>$('preferred-codec')).value as VideoCodec;
const autoSubscribe = (<HTMLInputElement>$('auto-subscribe')).checked;

setLogLevel(LogLevel.debug);
updateSearchParams(url, token);
Expand All @@ -79,7 +80,7 @@ const appActions = {
};

const connectOpts: RoomConnectOptions = {
autoSubscribe: true,
autoSubscribe: autoSubscribe,
};
if (forceTURN) {
connectOpts.rtcConfig = {
Expand Down