- Replace onBeforeRender stereo detection to use cascading fallbacks:
1. Direct xrCamera.cameras[0]/[1] comparison
2. View matrix matrixWorldInverse.elements[12] with 0.001 threshold
3. Projection matrix elements[8] as last resort
- Add video texture sync in renderXR before render call
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace camera reference comparison with view matrix eye detection
for more reliable left/right eye identification. Recent Quest Browser
updates (Chromium 138/140, Horizon OS v83) changed WebXR multiview
behavior, causing the previous xrCamera.cameras[0]/[1] comparison
to fail intermittently on the left eye.
The new approach uses activeCamera.matrixWorldInverse.elements[12]
(the X translation in the view matrix) which reliably indicates:
- Negative value = left eye
- Positive value = right eye
This method is consistent across both Quest Browser and Safari/VisionOS.
Also adds explicit video texture synchronization in the render loop
to prevent timing-related glitches.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed canvas positioning from absolute to relative in start2DMode()
- Resolves issue where content below video was hidden underneath canvas
- Fixes canvas disappearing during page resize and fullscreen operations
- Canvas now properly flows within document layout
- Updated index.html with latest changes
- Updated vr180player/vr180-player.css with styling improvements
- Updated sbs-video.mp4 with new video content
- Fixed onWindowResize() to use container dimensions instead of hidden video element
- Updated start2DMode() to use consistent container-based sizing logic
- Added fullscreen event listeners to handle resize during fullscreen transitions
- Added minimum dimension constraints to prevent zero-sized canvas
- Canvas now maintains proper dimensions during window resize and fullscreen operations
- Remove static HTML elements (play button and control panel) from index.html
- Add createPlayButton() and create2DControlPanel() functions to dynamically generate UI
- Update DOMContentLoaded handler to create and insert UI elements on page load
- Maintain all existing functionality while making player more modular and self-contained
- UI elements are now created entirely by JavaScript, making the player easier to integrate
- Tested and verified: play button appears correctly, 2D mode works, controls function properly
- Create vr180player/ folder with organized structure:
- vr180player/images/ for all UI control images
- vr180player/vr180-player.js and vr180player/vr180-player.css
- Move poster.jpg back to root level alongside main content files
- Update all file references in index.html and CSS files
- Maintain clean separation between main content and player components
- All functionality preserved with improved organization
- Modify on2DTouchStart() to check dragging state before showing controls
- Prevents controls from appearing during active touch dragging
- Makes touch behavior consistent with mouse dragging behavior
- Controls hide when dragging starts and show when dragging ends
- Resolves issue where touch dragging would show controls while mouse dragging correctly hid them
- Ensures seamless user experience across desktop and mobile devices
- Add CSS classes (.muted/.unmuted) for mute button state management
- Fix button logic to show action that will be taken (standard UI pattern):
- When audio playing (unmuted): shows mute icon (click to mute)
- When audio muted: shows unmute icon (click to unmute)
- Add proper hover states for both mute and unmute icons
- Initialize button state correctly on video load
- Smooth 0.15s transitions between all states
- Follows standard media player UI conventions