diff --git a/web/package-lock.json b/web/package-lock.json index 35a75663a..e3bec267b 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -52,6 +52,7 @@ "react-tracked": "^1.7.11", "react-transition-group": "^4.4.5", "react-use-websocket": "^4.7.0", + "react-zoom-pan-pinch": "^3.4.3", "recoil": "^0.7.7", "scroll-into-view-if-needed": "^3.1.0", "sonner": "^1.4.0", @@ -6694,6 +6695,19 @@ "react-dom": ">= 18.0.0" } }, + "node_modules/react-zoom-pan-pinch": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/react-zoom-pan-pinch/-/react-zoom-pan-pinch-3.4.3.tgz", + "integrity": "sha512-x5MFlfAx2D6NTpZu8OISqc2nYn4p+YEaM1p21w7S/VE1wbVzK8vRzTo9Bj1ydufa649MuP7JBRM3vvj1RftFZw==", + "engines": { + "node": ">=8", + "npm": ">=5" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/web/package.json b/web/package.json index a9ea40891..0eebdaec1 100644 --- a/web/package.json +++ b/web/package.json @@ -57,6 +57,7 @@ "react-tracked": "^1.7.11", "react-transition-group": "^4.4.5", "react-use-websocket": "^4.7.0", + "react-zoom-pan-pinch": "^3.4.3", "recoil": "^0.7.7", "scroll-into-view-if-needed": "^3.1.0", "sonner": "^1.4.0", diff --git a/web/src/components/player/HlsVideoPlayer.tsx b/web/src/components/player/HlsVideoPlayer.tsx index 0ede0ea3c..4492bae43 100644 --- a/web/src/components/player/HlsVideoPlayer.tsx +++ b/web/src/components/player/HlsVideoPlayer.tsx @@ -27,6 +27,7 @@ import { } from "react-icons/md"; import useKeyboardListener from "@/hooks/use-keyboard-listener"; import { Slider } from "../ui/slider-volume"; +import { TransformComponent, TransformWrapper } from "react-zoom-pan-pinch"; const HLS_MIME_TYPE = "application/vnd.apple.mpegurl" as const; const unsupportedErrorCodes = [ @@ -169,48 +170,54 @@ export default function HlsVideoPlayer({ } onClick={isDesktop ? undefined : () => setControls(!controls)} > -