Skip to content

Commit f0ffd06

Browse files
authored
add --auto-subscribe cli option to enable auto-subscribe to published tracks in a room (#566)
* add cli option to enable auto-subscribe to published tracks in a room * revert default to true to keep existing behavior unchanged * Revert "revert default to true to keep existing behavior unchanged" This reverts commit 82aa183. * clean up cli command parsing, remove unnecessary code * bump version to 2.4.7
1 parent 898d0da commit f0ffd06

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cmd/lk/room.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ var (
177177
Usage: "read attributes from a `JSON` file",
178178
TakesFile: true,
179179
},
180+
&cli.BoolFlag{
181+
Name: "auto-subscribe",
182+
Usage: "Automatically subscribe to published tracks.",
183+
Value: false,
184+
},
180185
},
181186
},
182187
{
@@ -784,6 +789,8 @@ func joinRoom(ctx context.Context, cmd *cli.Command) error {
784789
return err
785790
}
786791

792+
autoSubscribe := cmd.Bool("auto-subscribe")
793+
787794
participantIdentity := cmd.String("identity")
788795

789796
done := make(chan os.Signal, 1)
@@ -907,7 +914,7 @@ func joinRoom(ctx context.Context, cmd *cli.Command) error {
907914
RoomName: roomName,
908915
ParticipantIdentity: participantIdentity,
909916
ParticipantAttributes: participantAttributes,
910-
}, roomCB)
917+
}, roomCB, lksdk.WithAutoSubscribe(autoSubscribe))
911918
if err != nil {
912919
return err
913920
}

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
package livekitcli
1616

1717
const (
18-
Version = "2.4.6"
18+
Version = "2.4.7"
1919
)

0 commit comments

Comments
 (0)