Add a video player, launched by selecting a video file from the Files app

This commit is contained in:
James Babcock committed 2026-09-28 14:11:04 -07:00
1 parent deaa93fead
commit cb6dddd120
13 files changed
+1784 -3

No files matched your search

+6
View File
@@ -44,6 +44,10 @@ export type InProcessWindowOptions = {
onSystemMenuOpened?: () => void;
onAppMenuOpened?: () => void;
setScreenOn?: ShellWindow["setScreenOn"];
/** See ShellWindow.keepsScreenOn. */
keepsScreenOn?: ShellWindow["keepsScreenOn"];
/** The window came to or left the foreground (after its surface visibility follows). */
onForegroundChanged?: (foreground: boolean) => void;
/** Shared actions; requestRender is rebound to this window's render. */
actions: LayerActions;
/**
@@ -162,6 +166,7 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
acceptsDirectional: true,
holdToTalk: options.holdToTalk,
isVoiceCapturing: options.isVoiceCapturing,
keepsScreenOn: options.keepsScreenOn,
setScreenOn: options.setScreenOn,
heightMode,
hasAppMenu: () => appMenuItems().length > 0,
@@ -218,6 +223,7 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
onFocus: options.onFocus,
setForeground: (foreground) => {
options.setSurfaceVisible(foreground);
options.onForegroundChanged?.(foreground);
},
};
const setHeightMode = (mode: WindowHeightMode) => {
+10 -1
View File
@@ -101,6 +101,12 @@ export type ShellWindow = {
holdToTalk?: boolean;
/** A window owns microphone capture outside the shell voice dialog. */
isVoiceCapturing?: () => boolean;
/**
* True while the window shows something the wearer watches without
* touching anything (a playing video): the idle screen timeout waits, as
* it does for voice capture, while this window is in the foreground.
*/
keepsScreenOn?: () => boolean;
/**
* True when the window gives swipe-left / swipe-right (watch directional
* input) a meaning; otherwise the shell forwards directionalFallback(event).
@@ -647,7 +653,10 @@ class Shell {
// ring. An in-flight assistant turn suspends it for the same reason (a
// tool loop can run for a while with no input); once the turn ends and
// the Done/Follow-up menu is showing, the normal idle timeout resumes.
if (this.activeVoiceLayer || this.activeKeyboardLayer || this.assistantSession?.isTurnActive() || this.foregroundWindow()?.isVoiceCapturing?.()) {
// A foreground window that is playing video holds it off the same way.
const foreground = this.foregroundWindow();
if (this.activeVoiceLayer || this.activeKeyboardLayer || this.assistantSession?.isTurnActive() ||
foreground?.isVoiceCapturing?.() || foreground?.keepsScreenOn?.()) {
this.lastInputAtMs = nowMs;
return false;
}