🎥 Make videos programmatically with React
handle pause after play in firefox and safari
Jonny Burger733ebd17c45d
diff --git a/packages/core/src/play-and-handle-not-allowed-error.ts b/packages/core/src/play-and-handle-not-allowed-error.tsindex f71ce63b77..b7deea73f3 100644--- a/packages/core/src/play-and-handle-not-allowed-error.ts+++ b/packages/core/src/play-and-handle-not-allowed-error.ts@@ -12,10 +12,25 @@ export const playAndHandleNotAllowedError = (return;}+ // Pause was called after play in Chromeif (err.message.includes('request was interrupted by a call to pause')) {return;}+ // Pause was called after play in Safari+ if (err.message.includes('The operation was aborted.')) {+ return;+ }++ // Pause was called after play in Firefox+ if (+ err.message.includes(+ 'The fetching process for the media resource was aborted by the user agent'+ )+ ) {+ 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);