Skip to content

Commit 743cfa5

Browse files
authored
update replay (#697)
1 parent 74fd243 commit 743cfa5

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

cmd/lk/replay.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
authutil "github.com/livekit/livekit-cli/v2/pkg/auth"
2626
"github.com/livekit/livekit-cli/v2/pkg/util"
2727
"github.com/livekit/protocol/auth"
28+
"github.com/livekit/protocol/livekit"
2829
"github.com/livekit/protocol/replay"
2930
"github.com/livekit/server-sdk-go/v2/signalling"
3031
)
@@ -48,6 +49,11 @@ var (
4849
Usage: "Playback room name",
4950
Required: false,
5051
},
52+
&cli.StringFlag{
53+
Name: "token",
54+
Usage: "Pagination token",
55+
Required: false,
56+
},
5157
},
5258
},
5359
{
@@ -66,7 +72,7 @@ var (
6672
Required: true,
6773
},
6874
&cli.IntFlag{
69-
Name: "pts",
75+
Name: "offset",
7076
Usage: "Playback start time",
7177
Required: false,
7278
},
@@ -83,7 +89,7 @@ var (
8389
Required: true,
8490
},
8591
&cli.IntFlag{
86-
Name: "pts",
92+
Name: "offset",
8793
Usage: "Playback start time",
8894
Required: true,
8995
},
@@ -145,6 +151,10 @@ func listReplays(ctx context.Context, cmd *cli.Command) error {
145151
req := &replay.ListReplaysRequest{
146152
RoomName: cmd.String("room"),
147153
}
154+
if token := cmd.String("token"); token != "" {
155+
req.PageToken = &livekit.TokenPagination{Token: token}
156+
}
157+
148158
res, err := replayClient.ListReplays(ctx, req)
149159
if err != nil {
150160
return err
@@ -170,9 +180,9 @@ func loadReplay(ctx context.Context, cmd *cli.Command) error {
170180
}
171181

172182
req := &replay.PlaybackRequest{
173-
ReplayId: cmd.String("id"),
174-
RoomName: cmd.String("room"),
175-
StartTime: int64(cmd.Int("pts")),
183+
ReplayId: cmd.String("id"),
184+
PlaybackRoom: cmd.String("room"),
185+
SeekOffset: int64(cmd.Int("pts")),
176186
}
177187
res, err := replayClient.Playback(ctx, req)
178188
if err != nil {
@@ -191,7 +201,7 @@ func seek(ctx context.Context, cmd *cli.Command) error {
191201

192202
req := &replay.SeekRequest{
193203
PlaybackId: cmd.String("id"),
194-
StartTime: int64(cmd.Int("pts")),
204+
SeekOffset: int64(cmd.Int("pts")),
195205
}
196206
_, err = replayClient.Seek(ctx, req)
197207
return err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/go-logr/logr v1.4.3
1515
github.com/go-task/task/v3 v3.44.1
1616
github.com/joho/godotenv v1.5.1
17-
github.com/livekit/protocol v1.42.0
17+
github.com/livekit/protocol v1.42.1-0.20250929175250-2ddfb3ee7f7e
1818
github.com/livekit/server-sdk-go/v2 v2.11.3
1919
github.com/moby/buildkit v0.23.2
2020
github.com/moby/patternmatcher v0.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 h1:9x+U2HGLrSw5AT
274274
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
275275
github.com/livekit/mediatransportutil v0.0.0-20250825135402-7bc31f107ade h1:lpxPcglwzUWNB4J0S2qZuyMehzmR7vW9whzSwV4IGoI=
276276
github.com/livekit/mediatransportutil v0.0.0-20250825135402-7bc31f107ade/go.mod h1:mSNtYzSf6iY9xM3UX42VEI+STHvMgHmrYzEHPcdhB8A=
277-
github.com/livekit/protocol v1.42.0 h1:cd6kkh0eW4/HvNs5hbsWoUlC3CAVyd+ohBAXpdPRgxA=
278-
github.com/livekit/protocol v1.42.0/go.mod h1:vhMS30QoEyH2p34vi6X1eWkC4EMV72ZGZwQb74ajY7A=
277+
github.com/livekit/protocol v1.42.1-0.20250929175250-2ddfb3ee7f7e h1:yytr+uwFXtJ8UxBV2q3j55jVKg7zslECuGeE4F56NoU=
278+
github.com/livekit/protocol v1.42.1-0.20250929175250-2ddfb3ee7f7e/go.mod h1:vhMS30QoEyH2p34vi6X1eWkC4EMV72ZGZwQb74ajY7A=
279279
github.com/livekit/psrpc v0.7.0 h1:rtfqfjYN06WJYloE/S0nmkJ/Y04x4pxLQLe8kQ4FVHU=
280280
github.com/livekit/psrpc v0.7.0/go.mod h1:AuDC5uOoEjQJEc69v4Li3t77Ocz0e0NdjQEuFfO+vfk=
281281
github.com/livekit/server-sdk-go/v2 v2.11.3 h1:k+YDxo8wPCixRrS9fJHcbtlurlXhVLfyPva5Ne4tVH0=

0 commit comments

Comments
 (0)