@remotion/player 4.0.454 → 4.0.455

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.
@@ -74,6 +74,16 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
74
74
  }, []);
75
75
  const player = (0, use_player_js_1.usePlayer)();
76
76
  const playerToggle = player.toggle;
77
+ const { mediaMuted, mediaVolume } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
78
+ (0, react_1.useEffect)(() => {
79
+ player.emitter.dispatchVolumeChange(mediaVolume);
80
+ }, [player.emitter, mediaVolume]);
81
+ const isMuted = mediaMuted || mediaVolume === 0;
82
+ (0, react_1.useEffect)(() => {
83
+ player.emitter.dispatchMuteChange({
84
+ isMuted,
85
+ });
86
+ }, [player.emitter, isMuted]);
77
87
  (0, use_playback_js_1.usePlayback)({
78
88
  loop,
79
89
  playbackRate,
@@ -82,6 +92,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
82
92
  outFrame,
83
93
  getCurrentFrame: player.getCurrentFrame,
84
94
  browserMediaControlsBehavior,
95
+ muted: isMuted,
85
96
  });
86
97
  (0, react_1.useEffect)(() => {
87
98
  if (hasPausedToResume && !player.playing) {
@@ -191,16 +202,6 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
191
202
  player.emitter.dispatchScaleChange(scale);
192
203
  }, [player.emitter, scale]);
193
204
  const { setMediaVolume, setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
194
- const { mediaMuted, mediaVolume } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
195
- (0, react_1.useEffect)(() => {
196
- player.emitter.dispatchVolumeChange(mediaVolume);
197
- }, [player.emitter, mediaVolume]);
198
- const isMuted = mediaMuted || mediaVolume === 0;
199
- (0, react_1.useEffect)(() => {
200
- player.emitter.dispatchMuteChange({
201
- isMuted,
202
- });
203
- }, [player.emitter, isMuted]);
204
205
  const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
205
206
  (0, react_1.useEffect)(() => {
206
207
  let timeout = null;
@@ -32,7 +32,7 @@ export declare const PlayerInternals: {
32
32
  isBuffering: () => boolean;
33
33
  toggle: (e?: PointerEvent | import("react").SyntheticEvent<Element, Event> | undefined) => void;
34
34
  };
35
- usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, }: {
35
+ usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, muted, }: {
36
36
  loop: boolean;
37
37
  playbackRate: number;
38
38
  moveToBeginningWhenEnded: boolean;
@@ -40,6 +40,7 @@ export declare const PlayerInternals: {
40
40
  outFrame: number | null;
41
41
  browserMediaControlsBehavior: import("./browser-mediasession.js").BrowserMediaControlsBehavior;
42
42
  getCurrentFrame: import("./use-frame-imperative.js").GetCurrentFrame;
43
+ muted: boolean;
43
44
  }) => void;
44
45
  useElementSize: (ref: import("react").RefObject<HTMLElement | null>, options: {
45
46
  triggerOnWindowResize: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { BrowserMediaControlsBehavior } from './browser-mediasession.js';
2
2
  import type { GetCurrentFrame } from './use-frame-imperative.js';
3
- export declare const usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, }: {
3
+ export declare const usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, muted, }: {
4
4
  loop: boolean;
5
5
  playbackRate: number;
6
6
  moveToBeginningWhenEnded: boolean;
@@ -8,4 +8,5 @@ export declare const usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnde
8
8
  outFrame: number | null;
9
9
  browserMediaControlsBehavior: BrowserMediaControlsBehavior;
10
10
  getCurrentFrame: GetCurrentFrame;
11
+ muted: boolean;
11
12
  }) => void;
@@ -10,7 +10,7 @@ const calculate_next_frame_js_1 = require("./calculate-next-frame.js");
10
10
  const is_backgrounded_js_1 = require("./is-backgrounded.js");
11
11
  const set_global_time_anchor_js_1 = require("./set-global-time-anchor.js");
12
12
  const use_player_js_1 = require("./use-player.js");
13
- const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, }) => {
13
+ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, browserMediaControlsBehavior, getCurrentFrame, muted, }) => {
14
14
  const config = remotion_1.Internals.useUnsafeVideoConfig();
15
15
  const frame = remotion_1.Internals.Timeline.useTimelinePosition();
16
16
  const { playing, pause, emitter, isPlaying } = (0, use_player_js_1.usePlayer)();
@@ -152,7 +152,7 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
152
152
  });
153
153
  return;
154
154
  }
155
- if (context.buffering.current) {
155
+ if (context.buffering.current && !muted) {
156
156
  (_b = sharedAudioContext === null || sharedAudioContext === void 0 ? void 0 : sharedAudioContext.suspend) === null || _b === void 0 ? void 0 : _b.call(sharedAudioContext);
157
157
  const stopListening = context.listenForResume(() => {
158
158
  stopListening.remove();
@@ -205,6 +205,7 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
205
205
  sharedAudioContext,
206
206
  timelineContext.playbackRate,
207
207
  logLevel,
208
+ muted,
208
209
  ]);
209
210
  (0, react_2.useEffect)(() => {
210
211
  const now = performance.now();
@@ -935,7 +935,8 @@ var usePlayback = ({
935
935
  inFrame,
936
936
  outFrame,
937
937
  browserMediaControlsBehavior,
938
- getCurrentFrame
938
+ getCurrentFrame,
939
+ muted
939
940
  }) => {
940
941
  const config = Internals7.useUnsafeVideoConfig();
941
942
  const frame = Internals7.Timeline.useTimelinePosition();
@@ -1065,7 +1066,7 @@ var usePlayback = ({
1065
1066
  });
1066
1067
  return;
1067
1068
  }
1068
- if (context.buffering.current) {
1069
+ if (context.buffering.current && !muted) {
1069
1070
  sharedAudioContext?.suspend?.();
1070
1071
  const stopListening = context.listenForResume(() => {
1071
1072
  stopListening.remove();
@@ -1114,7 +1115,8 @@ var usePlayback = ({
1114
1115
  isPlaying,
1115
1116
  sharedAudioContext,
1116
1117
  timelineContext.playbackRate,
1117
- logLevel
1118
+ logLevel,
1119
+ muted
1118
1120
  ]);
1119
1121
  useEffect5(() => {
1120
1122
  const now = performance.now();
@@ -2538,6 +2540,16 @@ var PlayerUI = ({
2538
2540
  }, []);
2539
2541
  const player = usePlayer();
2540
2542
  const playerToggle = player.toggle;
2543
+ const { mediaMuted, mediaVolume } = useContext5(Internals12.MediaVolumeContext);
2544
+ useEffect12(() => {
2545
+ player.emitter.dispatchVolumeChange(mediaVolume);
2546
+ }, [player.emitter, mediaVolume]);
2547
+ const isMuted = mediaMuted || mediaVolume === 0;
2548
+ useEffect12(() => {
2549
+ player.emitter.dispatchMuteChange({
2550
+ isMuted
2551
+ });
2552
+ }, [player.emitter, isMuted]);
2541
2553
  usePlayback({
2542
2554
  loop,
2543
2555
  playbackRate,
@@ -2545,7 +2557,8 @@ var PlayerUI = ({
2545
2557
  inFrame,
2546
2558
  outFrame,
2547
2559
  getCurrentFrame: player.getCurrentFrame,
2548
- browserMediaControlsBehavior
2560
+ browserMediaControlsBehavior,
2561
+ muted: isMuted
2549
2562
  });
2550
2563
  useEffect12(() => {
2551
2564
  if (hasPausedToResume && !player.playing) {
@@ -2641,16 +2654,6 @@ var PlayerUI = ({
2641
2654
  player.emitter.dispatchScaleChange(scale);
2642
2655
  }, [player.emitter, scale]);
2643
2656
  const { setMediaVolume, setMediaMuted } = useContext5(Internals12.SetMediaVolumeContext);
2644
- const { mediaMuted, mediaVolume } = useContext5(Internals12.MediaVolumeContext);
2645
- useEffect12(() => {
2646
- player.emitter.dispatchVolumeChange(mediaVolume);
2647
- }, [player.emitter, mediaVolume]);
2648
- const isMuted = mediaMuted || mediaVolume === 0;
2649
- useEffect12(() => {
2650
- player.emitter.dispatchMuteChange({
2651
- isMuted
2652
- });
2653
- }, [player.emitter, isMuted]);
2654
2657
  const [showBufferIndicator, setShowBufferState] = useState11(false);
2655
2658
  useEffect12(() => {
2656
2659
  let timeout = null;
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.454",
6
+ "version": "4.0.455",
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",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "license": "SEE LICENSE IN LICENSE.md",
38
38
  "dependencies": {
39
- "remotion": "4.0.454"
39
+ "remotion": "4.0.455"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",
@@ -50,7 +50,7 @@
50
50
  "react-dom": "19.2.3",
51
51
  "webpack": "5.105.0",
52
52
  "zod": "4.3.6",
53
- "@remotion/eslint-config-internal": "4.0.454",
53
+ "@remotion/eslint-config-internal": "4.0.455",
54
54
  "eslint": "9.19.0",
55
55
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
56
56
  },