Skip to content

Commit

Permalink
Auto define the Web Component
Browse files Browse the repository at this point in the history
  • Loading branch information
nhoizey committed Jul 7, 2022
1 parent 665906c commit c3087be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions responsive-video-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ export class ResponsiveVideoBackground extends HTMLElement {
}
}
}

if (
typeof window !== 'undefined' &&
'customElements' in window &&
window.customElements.get(ResponsiveVideoBackground.is) === undefined
) {
window.customElements.define(ResponsiveVideoBackground.is, ResponsiveVideoBackground);
}

0 comments on commit c3087be

Please sign in to comment.