Arnavion / libjass

Renders ASS subs in the browser.
Apache License 2.0
174 stars 29 forks source link

Cannot read property 'fontMap' of undefined #94

Closed kozec closed 6 years ago

kozec commented 7 years ago

It appears that .settings property of WebRenderer is not being set anywhere, at least not before its first use at https://github.com/Arnavion/libjass/blob/master/src/renderers/web/renderer.ts#L150

My backtrace: libjass.js:5904 Uncaught (in promise) TypeError: Cannot read property 'fontMap' of undefined at Object.WebRenderer (libjass.js:5904) at Object.DefaultRenderer (libjass.js:5176) at VideoPlayer.subtitles_parsed (index.py.js:2928) at index.py.js:38 at

Arnavion commented 7 years ago

https://github.com/Arnavion/libjass/blob/master/src/renderers/web/renderer.ts#L118 https://github.com/Arnavion/libjass/blob/master/src/renderers/null.ts#L47

aahmyu commented 6 years ago
image

this.sub = libjass.ASS.fromUrl(myURL); this.sub.then((ass: any): void => { this.render = libjass.renderers.DefaultRenderer(this.video.nativeElement, ass, {}); });

Trying to implement this in an angular component and can't get it to work for the life of me :(

Arnavion commented 6 years ago

this.render = libjass.renderers.DefaultRenderer(...) is missing a new