Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion projects/client/src/lib/features/errors/ErrorProvider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@
// browser extensions as a second copy alongside Plyr's own instance.
// When the iframe is torn down during SPA navigation the orphaned
// API copy accesses stale registry entries; not actionable for us.
error.stack?.includes("www-widgetapi.js");
error.stack?.includes("www-widgetapi.js") ||
// Plyr's own scripts throw from an XHR error listener on network-layer
// failures (e.g. Error: 0). Sentry wraps XMLHttpRequest and injects an
// app-origin frame, so the hostname check above lets these through even
// though the originating frame is third-party. A cosmetic player hiccup
// must not escalate to the full-page error screen. Match both the CDN
// host and the bare filename so self-hosted/bundled Plyr is covered too.
error.stack?.includes("cdn.plyr.io") ||
error.stack?.includes("plyr.js");

if (isExternalNoise) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
const options: Plyr.Options = {
controls: ["play", "progress", "current-time", "mute", "fullscreen"],
iconUrl: asset("/plyr/plyr.svg"),
/**
* Reference the icon sprite via an external `<use>` instead of letting
* Plyr XHR-fetch and inline it. Plyr's sprite loader throws
* `new Error(xhr.status)` from the XHR `error` listener (uncaught, outside
* its own try/catch), so any network-layer failure surfaces as an
* uncaught `Error: 0` and escalates to the full-page error screen.
*/
loadSprite: false,
autoplay,
fullscreen: {
enabled: true,
Expand Down
Loading