Open Tatenda opened 5 years ago
The fastest way is to take a look yourself and create a pull request 👍
Hi, a possible solution in Angular Universal is to use dynamic imports:
if (isPlatformBrowser(this.platformId)){
import('plyr').then(
(plyr) => (this.plyr = new plyr.default(this.elementRef.nativeElement))
);
}
This code will make Plyr available only in the browser, while ensuring that Angular Universal works correctly.
I am trying to use this plugin in an app which uses Angular Universal. However it tells me document is not defined (which is expected). I would like to request a fix to this issue.