🎥 Make videos programmatically with React
ignore play errors when interrupted by a call to pause()
Jonny Burger32756acd32d5
diff --git a/packages/core/src/use-media-playback.ts b/packages/core/src/use-media-playback.tsindex e54ed846e2..68de452a32 100644--- a/packages/core/src/use-media-playback.ts+++ b/packages/core/src/use-media-playback.ts@@ -13,11 +13,15 @@ const playAndHandleNotAllowedError = (const {current} = mediaRef;const prom = current?.play();if (prom?.catch) {- prom?.catch((err) => {+ prom?.catch((err: Error) => {if (!current) {return;}+ if (err.message.includes('request was interrupted by a call to pause')) {+ return;+ }+console.log(`Could not play ${mediaType} due to following error: `, err);if (!current.muted) {console.log(`The video will be muted and we'll retry playing it.`, err);