Skip to content

Conversation

@oNaiPs
Copy link
Contributor

@oNaiPs oNaiPs commented Sep 4, 2025

On iOS Safari, the <video> element often reports videoWidth/videoHeight as 0 when only loadedmetadata has fired. This causes DigitalPTZ.updateRects() to bail early, leaving this.videoRect unset and breaking pinch-to-zoom until a later navigation or redraw.

This PR adds an additional listener for the loadeddata event, which reliably fires once the first frame is available and dimensions are known. With this change, this.videoRect is correctly initialized on iOS and pinch-to-zoom works immediately.


Changes

  • Add videoEl.addEventListener("loadeddata", this.recomputeRects); in DigitalPTZ constructor
  • Ensures this.videoRect is set when the video dimensions are first available on iOS

@AlexxIT AlexxIT merged commit 2281d66 into AlexxIT:master Sep 4, 2025
2 checks passed
@AlexxIT
Copy link
Owner

AlexxIT commented Sep 4, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants