Skip to content

Play announcement on incompatible GC4A 2.0 devices#81

Merged
maximmaxim345 merged 4 commits into
mainfrom
feat/cast-app-death-detection
May 7, 2026
Merged

Play announcement on incompatible GC4A 2.0 devices#81
maximmaxim345 merged 4 commits into
mainfrom
feat/cast-app-death-detection

Conversation

@maximmaxim345
Copy link
Copy Markdown
Member

Play a "This device is not compatible with Sendspin." announcement when AudioContext isn't available.

This is specifically targeting Cast devices based on GC4A 2.0. Compared to the other cast runtimes it has no APIs that allow synchronized playback, which is required for this Cast App.

GC4A 2.0-based devices lack AudioContext. Play a spoken error
message via HTML5 Audio before triggering the fatal error flow.
setTimeout in ensureAudioContextSupported was never cleared when the
audio's onended/onerror handler fired first, leaving a 15s timer with a
held closure reference. Stash the timer id and clearTimeout in the
shared finish handler.
@maximmaxim345 maximmaxim345 requested a review from Copilot May 7, 2026 13:22
@maximmaxim345 maximmaxim345 added the new-feature Request or implement a new feature label May 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an audible “device not compatible with Sendspin” announcement path for Cast receivers that lack AudioContext (notably GC4A 2.0), then proceeds through the existing fatal-error shutdown flow.

Changes:

  • Import an error-incompatible.mp3 asset and play it when AudioContext is unavailable.
  • Convert ensureAudioContextSupported() to async and await it during server connection.
  • Preserve existing fatal shutdown behavior after the announcement attempt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/js/main.ts Outdated
maximmaxim345 and others added 2 commits May 7, 2026 15:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@maximmaxim345 maximmaxim345 merged commit a90e75c into main May 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature Request or implement a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants