@remotion/player 4.0.331 → 4.0.333

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.
@@ -32,6 +32,11 @@ const checkmarkStyle = {
32
32
  };
33
33
  const Checkmark = () => ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: checkmarkStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z" }) }));
34
34
  exports.Checkmark = Checkmark;
35
+ const formatPlaybackRate = (rate) => {
36
+ const str = rate.toString();
37
+ // If the string doesn't contain a decimal point, add ".0"
38
+ return str.includes('.') ? str : str + '.0';
39
+ };
35
40
  const PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }) => {
36
41
  const onClick = (0, react_1.useCallback)((e) => {
37
42
  e.stopPropagation();
@@ -52,7 +57,7 @@ const PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate
52
57
  backgroundColor: hovered || isFocused ? '#eee' : 'transparent',
53
58
  };
54
59
  }, [hovered, isFocused]);
55
- return ((0, jsx_runtime_1.jsxs)("div", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, tabIndex: 0, style: actualStyle, onClick: onClick, children: [(0, jsx_runtime_1.jsx)("div", { style: checkmarkContainer, children: rate === selectedRate ? (0, jsx_runtime_1.jsx)(exports.Checkmark, {}) : null }), rate.toFixed(1), "x"] }, rate));
60
+ return ((0, jsx_runtime_1.jsxs)("div", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, tabIndex: 0, style: actualStyle, onClick: onClick, children: [(0, jsx_runtime_1.jsx)("div", { style: checkmarkContainer, children: rate === selectedRate ? (0, jsx_runtime_1.jsx)(exports.Checkmark, {}) : null }), formatPlaybackRate(rate), "x"] }, rate));
56
61
  };
57
62
  const PlaybackPopup = ({ setIsComponentVisible, playbackRates, canvasSize }) => {
58
63
  const { setPlaybackRate, playbackRate } = (0, react_1.useContext)(remotion_1.Internals.Timeline.TimelineContext);
@@ -1455,6 +1455,10 @@ var Checkmark = () => /* @__PURE__ */ jsx7("svg", {
1455
1455
  d: "M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"
1456
1456
  })
1457
1457
  });
1458
+ var formatPlaybackRate = (rate) => {
1459
+ const str = rate.toString();
1460
+ return str.includes(".") ? str : str + ".0";
1461
+ };
1458
1462
  var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }) => {
1459
1463
  const onClick = useCallback6((e) => {
1460
1464
  e.stopPropagation();
@@ -1486,7 +1490,7 @@ var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }
1486
1490
  style: checkmarkContainer,
1487
1491
  children: rate === selectedRate ? /* @__PURE__ */ jsx7(Checkmark, {}) : null
1488
1492
  }),
1489
- rate.toFixed(1),
1493
+ formatPlaybackRate(rate),
1490
1494
  "x"
1491
1495
  ]
1492
1496
  }, rate);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/player"
4
4
  },
5
5
  "name": "@remotion/player",
6
- "version": "4.0.331",
6
+ "version": "4.0.333",
7
7
  "description": "React component for embedding a Remotion preview into your app",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "remotion": "4.0.331"
31
+ "remotion": "4.0.333"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -43,7 +43,7 @@
43
43
  "webpack": "5.96.1",
44
44
  "zod": "3.22.3",
45
45
  "eslint": "9.19.0",
46
- "@remotion/eslint-config-internal": "4.0.331"
46
+ "@remotion/eslint-config-internal": "4.0.333"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",