@remotion/player 3.2.1 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,13 @@ const barBackground = {
34
34
  width: '100%',
35
35
  borderRadius: BAR_HEIGHT / 2,
36
36
  };
37
+ const findBodyInWhichDivIsLocated = (div) => {
38
+ let current = div;
39
+ while (current.parentElement) {
40
+ current = current.parentElement;
41
+ }
42
+ return current;
43
+ };
37
44
  const PlayerSeekBar = ({ durationInFrames }) => {
38
45
  const containerRef = (0, react_1.useRef)(null);
39
46
  const barHovered = (0, use_hover_state_1.useHoverState)(containerRef);
@@ -87,11 +94,12 @@ const PlayerSeekBar = ({ durationInFrames }) => {
87
94
  if (!dragging.dragging) {
88
95
  return;
89
96
  }
90
- window.addEventListener('pointermove', onPointerMove);
91
- window.addEventListener('pointerup', onPointerUp);
97
+ const body = findBodyInWhichDivIsLocated(containerRef.current);
98
+ body.addEventListener('pointermove', onPointerMove);
99
+ body.addEventListener('pointerup', onPointerUp);
92
100
  return () => {
93
- window.removeEventListener('pointermove', onPointerMove);
94
- window.removeEventListener('pointerup', onPointerUp);
101
+ body.removeEventListener('pointermove', onPointerMove);
102
+ body.removeEventListener('pointerup', onPointerUp);
95
103
  };
96
104
  }, [dragging.dragging, onPointerMove, onPointerUp]);
97
105
  const knobStyle = (0, react_1.useMemo)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/player",
3
- "version": "3.2.1",
3
+ "version": "3.2.4",
4
4
  "description": "Remotion Player",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "remotion": "3.2.1"
31
+ "remotion": "3.2.4"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "0c4f0e1fdd423b882bf3dbc48b50037f9d5251c8"
66
+ "gitHead": "ee420b99227e0e5bcf093c108e3695f5d46e3658"
67
67
  }