Skip to content

Commit 2281d66

Browse files
authored
Merge pull request #887 from oNaiPs/master
Fix iOS pinch-to-zoom initialization by listening to loadeddata event
2 parents cd84c4b + 54145d5 commit 2281d66

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

custom_components/webrtc/www/digital-ptz.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ export class DigitalPTZ {
5252
if (o.touch_drag_pan) h.push(startTouchDragPan(gestureParam));
5353
if (o.touch_pinch_zoom) h.push(startTouchPinchZoom(gestureParam));
5454
this.videoEl.addEventListener("loadedmetadata", this.recomputeRects);
55+
this.videoEl.addEventListener("loadeddata", this.recomputeRects);
5556
this.resizeObserver = new ResizeObserver(this.recomputeRects);
5657
this.resizeObserver.observe(this.containerEl);
5758
this.recomputeRects();
5859
}
5960
destroy() {
6061
for (const off of this.offHandles) off();
6162
this.videoEl.removeEventListener("loadedmetadata", this.recomputeRects);
63+
this.videoEl.removeEventListener("loadeddata", this.recomputeRects);
6264
this.resizeObserver.unobserve(this.containerEl);
6365
}
6466
}

0 commit comments

Comments
 (0)