Skip to content

Commit b1479e1

Browse files
authored
Merge pull request #74 from BKWLD/fix-ada-pause-control
Fix ADA pause control
2 parents 1467dae + 7615554 commit b1479e1

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

packages/react/src/LazyVideo/LazyVideoClient.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ export default function LazyVideoClient({
7777
// errors while trying to play.
7878
const play = async () => {
7979
if (playPromise.current) await playPromise.current;
80-
try {
81-
playPromise.current = videoRef.current?.play();
82-
} catch (e) {
83-
console.error(e);
84-
}
80+
playPromise.current = videoRef.current?.play().catch((e) => {});
8581
};
8682

8783
// Pause the video, waiting until it's safe to play it
@@ -103,12 +99,12 @@ export default function LazyVideoClient({
10399

104100
const handlePlay = () => {
105101
setVideoPaused(false);
106-
onPlay && onPlay();
102+
onPlay?.();
107103
};
108104

109105
const handlePause = () => {
110106
setVideoPaused(true);
111-
onPause && onPause();
107+
onPause?.();
112108
};
113109

114110
// Add listeners

0 commit comments

Comments
 (0)