Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AntennaHead/Services/AntennaHeadHTTPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,8 @@ final class AntennaHeadHTTPServer {
s += " title='Take AntennaHead Radio off the air.'><br>&nbsp;<br>"
} else {
s += "<input class='twelve columns button button-primary' type='button' value='Go On Air' "
s += "onclick=\"loadContent('controlboothradio.html?action=start');\" "
s += "onclick=\"controlBoothRadioGoOnAirClicked(this.getAttribute('data-source'));\" "
s += "data-source='\(htmlAttribute(status.sourceName))' "
s += "title='Start AntennaHead Radio with the settings in ControlBooth&#39;s AntennaHead Radio tab. "
s += "It takes over the AirPlay receiver and this ControlBooth input while on air.'><br>&nbsp;<br>"
}
Expand Down
11 changes: 11 additions & 0 deletions Web/js/antennahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,17 @@ function controlBoothRadioPoll()

var controlBoothRadioPollIntervalID = setInterval(controlBoothRadioPoll, 2000);

// Go On Air: like the Listen buttons, start the page's audio player too —
// inside the click, so the browser allows playback. The station opens
// AntennaHead's input itself a moment later.
function controlBoothRadioGoOnAirClicked(sourceName)
{
loadContent("controlboothradio.html?action=start");
window.top.nowPlayingTitle = window.document.getElementById("listen_title");
showUpNextInNavBar(sourceName);
window.top.postMessage("startaudio", "*");
}

function controlBoothDsdNeoApplyMode(form)
{
var mode = form.elements["mode"].value;
Expand Down
Loading