Repository navigation
Fix: Chromecast Casting Not Playing - #7273
Open
dude-stash wants to merge 5 commits into
Open
dude-stash wants to merge 5 commits into
dude-stash wants to merge 5 commits into
Conversation
A Chromecast fetches media itself and can't reach localhost, so the UI needs an address of this machine on the LAN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every stream endpoint claims video/mp4, so the direct stream is only chosen when the file's container and codecs allow it, otherwise HLS. A localhost URL is pointed at a LAN address instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Chromecast tech now casts the stream picked for the device, at this machine's LAN address, with the scene title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeking now works while casting a transcoded scene: the device seeks the stream itself, so the transcode offset only applies to the browser's own player. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening another scene while casting no longer breaks the scene page, and the next scene loads on the Chromecast. The Chromecast tech is extended in the app instead of patched: it copes with a cast that outlives the previous player (no source or session manager yet, events after disposal), and defines setSource itself because Video.js only calls it on a tech whose own prototype has it. The Cast SDK is also loaded once per page, so the cast keeps going between scenes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dude-stash
force-pushed
the
chromecast/cast-fix
branch
from
October 11, 2026 15:26
0c1acdd to
d4b8bad
Compare
Contributor
Author
|
@Gykes I found another way to fix casting on vjs 7 without patching the silvermine chromecast plugin. The first two commits are what makes stash send a valid url to chromecast instead of localhost, which is also needed for vis 10 anyway. But this PR makes chromecast completely usable on vjs 7. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Casting to a Chromecast connects, but the TV never plays anything. There are two reasons:
video/mp4even for MKV, AVI or WMV files, which the TV can't play.localhost, which for the TV is the TV itself.This keeps
@silvermine/videojs-chromecastunmodified and fixes casting around it:systemStatus.localIPs.modifyLoadRequestFnoption swaps in a stream the TV can play: the direct stream for H.264 or H.265 with AAC or MP3 in MP4, otherwise HLS.localhostis replaced with the LAN address. Signed URLs keep working.live.tssteps aside while the Chromecast tech is active.The
@silvermine/videojs-chromecastplugin hasn't been maintained since 2024, so instead of patching it,ScenePlayer/chromecast-tech.tsregisters a subclass of its tech. It copes with a cast that outlives the previous player (no source or session manager yet, events after disposal), which was the plugin's open issue #96, and implementsloop,setLoopandseeking.It also defines
setSourceitself, because Video.js only calls it on a tech whose own prototype has it. This makes Chromecast work with Video.js 7 without patching the package.Only the last three commits are specific to the Video.js 7 player (
ScenePlayer.tsx,live.tsand the tech subclass).The first two stay needed after a move to Video.js 10, because they don't touch the player:
localIPson the server, andutils/castMedia.ts, which picks the stream and address.Related Issue
Fixes #4136. Replaces #7220.
Testing
Manual testing with a Chromecast with Google TV, an older Chromecast and a Google Nest Hub, from Chrome on macOS:
Automated checks:
go build ./...andgo test ./pkg/utils/ ./internal/manager/golangci-linton the changed Go packagespnpm run validate(biome, tsc, format)Screenshots
No visual changes.
Checklist
AI Usage Disclosure
I used Claude Code to investigate the problem, write the code and commit messages, and draft this description. I directed the work, reviewed every commit and did the manual testing on my own devices.
Additional Context
The commits are meant to be reviewed one at a time.