@remotion/player 4.0.301 → 4.0.302

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.
@@ -39,6 +39,7 @@ const usePlayer = () => {
39
39
  emitter.dispatchSeek(newFrame);
40
40
  }, [emitter, setTimelinePosition, video === null || video === void 0 ? void 0 : video.id]);
41
41
  const play = (0, react_1.useCallback)((e) => {
42
+ var _a;
42
43
  if (imperativePlaying.current) {
43
44
  return;
44
45
  }
@@ -46,6 +47,7 @@ const usePlayer = () => {
46
47
  if (isLastFrame) {
47
48
  seek(0);
48
49
  }
50
+ (_a = audioContext === null || audioContext === void 0 ? void 0 : audioContext.audioContext) === null || _a === void 0 ? void 0 : _a.resume();
49
51
  /**
50
52
  * Play silent audio tags to warm them up for autoplay
51
53
  */
@@ -71,12 +73,14 @@ const usePlayer = () => {
71
73
  audioAndVideoTags,
72
74
  ]);
73
75
  const pause = (0, react_1.useCallback)(() => {
76
+ var _a;
74
77
  if (imperativePlaying.current) {
75
78
  imperativePlaying.current = false;
76
79
  setPlaying(false);
77
80
  emitter.dispatchPause();
81
+ (_a = audioContext === null || audioContext === void 0 ? void 0 : audioContext.audioContext) === null || _a === void 0 ? void 0 : _a.suspend();
78
82
  }
79
- }, [emitter, imperativePlaying, setPlaying]);
83
+ }, [emitter, imperativePlaying, setPlaying, audioContext]);
80
84
  const pauseAndReturnToPlayStart = (0, react_1.useCallback)(() => {
81
85
  if (imperativePlaying.current) {
82
86
  imperativePlaying.current = false;
@@ -582,6 +582,7 @@ var usePlayer = () => {
582
582
  if (isLastFrame) {
583
583
  seek(0);
584
584
  }
585
+ audioContext?.audioContext?.resume();
585
586
  if (audioContext && audioContext.numberOfAudioTags > 0 && e) {
586
587
  audioContext.playAllAudios();
587
588
  }
@@ -604,8 +605,9 @@ var usePlayer = () => {
604
605
  imperativePlaying.current = false;
605
606
  setPlaying(false);
606
607
  emitter.dispatchPause();
608
+ audioContext?.audioContext?.suspend();
607
609
  }
608
- }, [emitter, imperativePlaying, setPlaying]);
610
+ }, [emitter, imperativePlaying, setPlaying, audioContext]);
609
611
  const pauseAndReturnToPlayStart = useCallback2(() => {
610
612
  if (imperativePlaying.current) {
611
613
  imperativePlaying.current = false;
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.301",
6
+ "version": "4.0.302",
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.301"
31
+ "remotion": "4.0.302"
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.301"
46
+ "@remotion/eslint-config-internal": "4.0.302"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",