Skip to content

Commit

Permalink
fix: cancelWatchAvailability promise catch
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Mar 22, 2024
1 parent a571e5f commit f5e81af
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/js/media-store/state-mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ export const stateMediator = {
if (value) {
media.pause();
} else {
media.play().catch(() => {});
// Not all custom media elements return a promise from `play()`.
media.play()?.catch(() => {});
}
},
mediaEvents: ['play', 'playing', 'pause', 'emptied'],
Expand Down Expand Up @@ -1103,7 +1104,9 @@ export const stateMediator = {
});
}
return () => {
media?.remote?.cancelWatchAvailability();
media?.remote
?.cancelWatchAvailability()
.catch(() => {});
};
},
],
Expand Down Expand Up @@ -1156,7 +1159,9 @@ export const stateMediator = {
});
}
return () => {
media?.remote?.cancelWatchAvailability();
media?.remote
?.cancelWatchAvailability()
.catch(() => {});
};
},
],
Expand Down

0 comments on commit f5e81af

Please sign in to comment.