Repository navigation
Add internet radio as a source: paste a stream's address - #6
Merged
Merged
Conversation
The source menu (S) gets a fifth row, a radio button and a field for a stream's address: the stream itself, MP3 or AAC from an Icecast or Shoutcast server, over http or https. Toaster comes with no stations: a stream is its station's to offer, and many don't let apps come with theirs. The last address that played is remembered with the other settings. It plays through an audio element as a file does (playElement, now shared with useFile), read cross-origin so the analysis hears it. The app's page is a file, which may read any stream that way; on the web page a stream only plays if its server allows it, and an https page can't play an http stream, which the error says. The CSP's media-src allows http and https for it. A stream that ends or drops says so and brings back the source menu, as system audio does when it stops. Stream titles (ICY metadata) aren't read, so the radio is untitled, like an input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 2 tasks
StopBanning
added a commit
to ljyjeffrey/toaster
that referenced
this pull request
Oct 27, 2026
# Conflicts: # README.md # docs/how-it-works.md
Owner
|
this is sick, thank you!! 🙏 both are merged and will ship in 0.4.22, and you're in the notes. tested here: radio paradise locks in at 109 in about 25 seconds, and WFMU plays in the app even with its server blocking other sites. re your question: the site picks up the media-src change on its own (its build copies the page's CSP and only adds the GitHub API). (#7 hit a one-line README conflict after #6's squash, so I merged main into your branch to clear it.) |
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.
Summary
playElement, now shared withuseFile), read cross-origin so the analysis hears it. The app's page is a file, which may read any stream that way (checked on Electron 44.7.0 against a server sending no CORS header); on the web page a stream only plays if its server allows it, and an https page can't play an http stream, which the error says. The CSP'smedia-srcgainshttp: https:.One thing I couldn't check: toaster.locust.lol's page seems to carry its own CSP from a build step that isn't in this repo; if so, it needs the same
media-srcfor the radio to play there.Test plan
node tools/serve.mjs, headless Chromium, muted): Radio Paradise and Radio Swiss Jazz play, the analysis hears them (level, label in the footer), the address comes back after a reload.ftp://get the plain message; the message box stays up after Enter.crossOriginreads a remote stream with no CORS header (analyser sees the signal).npm starton Windows and on a Mac: S › radio, paste a stream, it plays and the code follows.🤖 Generated with Claude Code