forked from Blendman974/faceclaw
Merge branch 'main' of https://github.com/jimrandomh/faceclaw
This commit is contained in:
commit
3c3aa31542
19 files changed
+930
-39
No files matched your search
@@ -53,7 +53,9 @@ type FocusColumn = "actions" | "playlist";
|
||||
/**
|
||||
* Music controller app: metadata + album art + transport controls for the
|
||||
* active Android media session (any player that publishes one) or, on iOS,
|
||||
* the Apple Music system player or Spotify (signed in from the window menu),
|
||||
* the Apple Music system player; on both, Spotify through its Web API once
|
||||
* signed in from the window menu (optional on Android, where it adds
|
||||
* library browsing, shuffle / repeat / like and Spotify on other devices),
|
||||
* plus the player's queue when it exposes one
|
||||
* (scroll to a track, click to jump). With no session, the front page lists
|
||||
* the apps whose library can be browsed (click one to open its
|
||||
@@ -525,19 +527,21 @@ export function createMusicAppWindow(options: InProcessAppOptions): InProcessWin
|
||||
iconLetter: "M",
|
||||
icon: "music",
|
||||
closeable: true,
|
||||
// Music settings choose among Android media apps; iOS has Apple Music, plus Spotify's sign-in here.
|
||||
// Music settings choose among Android media apps (iOS has Apple Music
|
||||
// alone); Spotify's sign-in is optional on Android, where its media
|
||||
// session works without it.
|
||||
menuItems: () => {
|
||||
if (!global.isIOS) {
|
||||
return [{
|
||||
const spotify = spotifyService();
|
||||
return [
|
||||
...(global.isIOS ? [] : [{
|
||||
label: "Music settings",
|
||||
onSelect: (ctx) => {
|
||||
onSelect: (ctx: LayerContext) => {
|
||||
ctx.stack.pop();
|
||||
ctx.stack.push(new MusicSettingsLayer());
|
||||
},
|
||||
}];
|
||||
}
|
||||
const spotify = spotifyService();
|
||||
return spotify ? [spotifyMenuItem(spotify)] : [];
|
||||
}]),
|
||||
...(spotify ? [spotifyMenuItem(spotify)] : []),
|
||||
];
|
||||
},
|
||||
actions: options.actions,
|
||||
baseLayer: new MusicRootLayer(musicLayer),
|
||||
|
||||
@@ -8,25 +8,31 @@ import { submenuItem, TextPageLayer, type MenuItem } from "../../ui/menu";
|
||||
import { WindowMenuLayer } from "../../ui/window-menu";
|
||||
import { TextViewerLayer } from "../files/text-viewer";
|
||||
|
||||
const SETUP_INTRO = global.isIOS
|
||||
? "Faceclaw controls Spotify through Spotify's Web API, which needs a Spotify developer app of your own. Creating one is free; Spotify requires its owner to have Premium, and controlling playback needs Premium too."
|
||||
: "Faceclaw already shows and controls Spotify on this phone, like any music app. Signing in to Spotify's Web API is optional and adds browsing your Spotify library, playing from Spotify by voice, shuffle / repeat / like, and Spotify playing on your other devices. It needs a Spotify developer app of your own: creating one is free, Spotify requires its owner to have Premium, and controlling playback through it needs Premium too.";
|
||||
|
||||
const SETUP_HELP = [
|
||||
"Faceclaw controls Spotify through Spotify's Web API, which needs a Spotify developer app of your own. Creating one is free; Spotify requires its owner to have Premium, and controlling playback needs Premium too.",
|
||||
SETUP_INTRO,
|
||||
"",
|
||||
`1. On a computer, open ${SPOTIFY_DASHBOARD_URL.replace("https://", "")} and sign in with your Spotify account.`,
|
||||
"2. Create an app. Any name and description will do.",
|
||||
`3. Add this Redirect URI exactly: ${SPOTIFY_REDIRECT_URI}`,
|
||||
"4. Under \"Which API/SDKs are you planning to use?\", tick Web API, then save.",
|
||||
"5. Open the app's settings, copy its Client ID, and enter it as Client ID here.",
|
||||
"6. Choose Sign in, then finish on your phone: Faceclaw opens Spotify's sign-in page there.",
|
||||
"6. Choose Sign in, then finish on your phone: Faceclaw opens Spotify's sign-in page there (once Faceclaw is open on the phone, if it was in the background).",
|
||||
"",
|
||||
"Spotify plays on whichever of your devices is open (this phone, a computer, a speaker). To start music when nothing is playing, Spotify must be open on one of them.",
|
||||
"",
|
||||
"Others can sign in with your client ID once you add their Spotify email under User Management in the dashboard (up to five people).",
|
||||
].join("\n");
|
||||
|
||||
/** The Music app menu's Spotify row (iOS): sign in, sign out, client ID, setup help. */
|
||||
/** The Music app menu's Spotify row: sign in, sign out, client ID, setup help. */
|
||||
export function spotifyMenuItem(service: SpotifyService): MenuItem {
|
||||
return submenuItem("Spotify", (ctx) => ctx.stack.push(new SpotifyMenuLayer(service)), {
|
||||
description: "Sign in to Spotify to show and control it from the glasses.",
|
||||
description: global.isIOS
|
||||
? "Sign in to Spotify to show and control it from the glasses."
|
||||
: "Optional: sign in to Spotify to browse its library and play from it by voice.",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user