Mail in Search, Pick up where you left off on Home (evening first), Cast/AirPlay buttons
build-container / build (push) Successful in 13m46s
build-container / build (push) Successful in 13m46s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1981e66b8a
commit
3166a7b1ab
8 files changed
+56
-9
No files matched your search
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
// Send what is playing to a TV or speaker. Safari/iOS use the AirPlay picker; Chrome and Edge use the browser's own cast picker (Chromecast and
|
||||
// compatible TVs). The TV fetches the stream itself, so this works best where it can reach the server the same way this device does.
|
||||
const castOk = el => !!el && (!!(el.remote && el.remote.prompt) || typeof el.webkitShowPlaybackTargetPicker === 'function');
|
||||
async function castTo(el) {
|
||||
if (!el) return toast('Start something playing first');
|
||||
try {
|
||||
if (el.remote && el.remote.prompt) await el.remote.prompt();
|
||||
else if (typeof el.webkitShowPlaybackTargetPicker === 'function') el.webkitShowPlaybackTargetPicker();
|
||||
else toast('This browser cannot send to a TV or speaker. Try Safari (AirPlay) or Chrome (Cast).');
|
||||
} catch (e) { if (e && e.name !== 'NotAllowedError' && e.name !== 'AbortError') toast(e.name === 'NotSupportedError' || e.name === 'InvalidStateError' ? 'No TV or speaker found on this network' : (e.message || 'Could not cast')); }
|
||||
}
|
||||
Reference in new issue
Block a user