Conversation
Delay is now configured through the Sendspin protocol via `set_static_delay` server commands.
There was a problem hiding this comment.
Pull request overview
Adds per-player delay configuration to the Cast sender/receiver flow so the sender UI can set a delay value and the receiver forwards it into SendspinPlayer (with sign inversion at the boundary), plus forwards server-driven delay updates back to the sender.
Changes:
- Sender page: add a delay control (0–5000ms, default 330), persist to
localStorage, and send updates to the receiver via custom messages. - Receiver: apply
syncDelay(negated) when constructing/updatingSendspinPlayer, and forward server-driven delay changes back to the sender viaonDelayCommand.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/js/main.ts | Applies syncDelay updates (negated) and forwards delay updates back to sender via onDelayCommand. |
| src/index.html | Adds/persists delay input and sends/receives delay config messages to keep UI in sync. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… flip sendspin-js now uses positive = play earlier (matching the protocol), so the receiver no longer needs to negate at the boundary.
Squash merge of feat/delay-config
There was a problem hiding this comment.
Pull request overview
Implements per-player/static delay configuration across the Cast sender page and receiver, including persistence and bidirectional sync of delay updates, and updates the Sendspin JS SDK dependency to support delay commands.
Changes:
- Add sender-side delay control (0–5000ms, default 330), persist it to
localStorage, and send updates to the receiver via Cast custom messages. - Add receiver handling to forward server-issued delay changes back to the sender via
onDelayCommand. - Bump
@sendspin/sendspin-jsto3.0.0and update docs/lockfile accordingly.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/index.html |
Adds delay input + persistence + sender↔receiver message handling for delay updates. |
src/js/main.ts |
Hooks onDelayCommand to forward receiver/server delay changes back to sender. |
README.md |
Updates protocol documentation for new syncDelay semantics/range. |
package.json |
Updates @sendspin/sendspin-js dependency to 3.0.0. |
yarn.lock |
Lockfile updates for dependency bump and registry/resolution changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onDelayCommand: (delayMs: number) => { | ||
| providedSyncDelay = delayMs; | ||
| if (castContext) { | ||
| castContext.sendCustomMessage(CAST_NAMESPACE, undefined, { | ||
| type: "config", | ||
| syncDelay: delayMs, | ||
| }); | ||
| } |
There was a problem hiding this comment.
PR description mentions the receiver passes the delay to sendspin-js with a sign negation at the boundary, but here delayMs is forwarded to the sender and stored as-is. Please reconcile the sign convention between (a) UI/README (“positive = play earlier”), (b) values coming from onDelayCommand, and (c) what sendspin-js expects, so the sender slider doesn’t display the opposite of the actual playback adjustment.
Implements per-player delay configuration from Sendspin spec PR #67.
The sender page gets a delay input (0-5000ms, default 330) that persists to
localStorageand sends updates to the receiver via Cast custom messages. The receiver passes the delay to sendspin-js assyncDelay(sign-negated at the boundary).When the server changes the delay via
set_static_delay, the receiver forwards the new value back to the sender page throughonDelayCommand, keeping the slider and localStorage in sync.