Injects a 「VR 播放」 button into Jellyfin Web's video player page and plays
VR180 / VR360 stereo content on Meta Quest 3 directly in the browser, with
DirectPlay 8K HEVC, in-VR subtitles and an in-VR control panel.
Modules (src/, concatenated in filename order into dist/jfvr.js):
00-core.js namespace, shared state, GL helpers, layer/frame-hook registry
10-subtitles.js libass canvas -> head-locked quad layer, auto-cropped to ink,
with depth/size decoupling (angular-size lock)
20-controls.js in-VR control panel: progress/seek, transport, subtitle rows,
aiming beam, padlock, pure 2D canvas -> XR quad layer
30-hands.js system hand model (Three.js + generic-hand GLB) via a manually
driven projection layer
90-main.js boot, XR session lifecycle, rAF broker (rAF stops during XR),
input dispatch, settings panel, localStorage persistence
Key on-device findings are documented in HANDOFF.md §6 and README.md addenda:
requestAnimationFrame stops during an XR session, 3:2 pulldown at 90 Hz needs
updateTargetFrameRate(120), libass must be resized before entering VR, a quad's
local -Z is its plane normal, and hand aiming must use the gaze ray because the
emulated targetRaySpace points sideways. Quest does not expose eye tracking.
Docs: INTERFACES.md (module contract + addenda), README.md (measurements),
HANDOFF.md (handover notes). Credentials are NOT in the repo: deploy.py reads
the SSH password from the JF_PW environment variable.
29 lines
869 B
Bash
Executable File
29 lines
869 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Reconnect to the Quest 3 via SideQuest's ADB and expose its browser CDP on :9222
|
|
set -u
|
|
ADB=${ADB:-/opt/SideQuest/resources/platform-tools/adb}
|
|
CDP_PORT=${CDP_PORT:-9222}
|
|
|
|
if ! [ -x "$ADB" ]; then echo "adb not found at $ADB" >&2; exit 1; fi
|
|
|
|
echo "== devices =="
|
|
$ADB devices -l
|
|
|
|
if ! $ADB devices | grep -qE '\bdevice$'; then
|
|
echo "!! no authorized device. Reconnect SideQuest (wireless ADB) and retry." >&2
|
|
exit 2
|
|
fi
|
|
|
|
echo "== forward tcp:$CDP_PORT =="
|
|
$ADB forward --remove-all >/dev/null 2>&1
|
|
$ADB forward "tcp:$CDP_PORT" localabstract:chrome_devtools_remote
|
|
|
|
echo "== verify =="
|
|
for i in 1 2 3 4 5; do
|
|
v=$(curl -s --max-time 3 "http://127.0.0.1:$CDP_PORT/json/version" || true)
|
|
if [ -n "$v" ]; then echo "$v"; echo "OK: CDP ready on 127.0.0.1:$CDP_PORT"; exit 0; fi
|
|
sleep 1
|
|
done
|
|
echo "!! CDP not answering on $CDP_PORT" >&2
|
|
exit 3
|