You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the WebVTT lib assumes the existence of VTTCue in the window object passed in its constructor (and possibly VTTRegion), but it is not always true, i.e. when importing the lib ES6 style and under MS Edge.
In those conditions, the WebVTT parser internal parse method throws an exception: "Object doesn't support this operation", happening there for VTTCue.
In my scenario, I found a workaround - set VTTCue as a prop on the window object manually:
import{WebVTT,VTTCue}from'vtt.js'// the following line needs to happen before injecting the `window` object into the Parser constructorwindow.VTTCue=VTTCue;constparser=newWebVTT.Parser(window,WebVTT.StringDecoder());// no more error upon parsing!
I'll be happy to submit a PR if needed.
The text was updated successfully, but these errors were encountered:
2018 checking in. just confirming that this is still an issue. but much like those above, I took the quick fix route (which worked, thanks!) and moved on. sorry world. :)
Hi,
It looks like the WebVTT lib assumes the existence of
VTTCue
in thewindow
object passed in its constructor (and possibly VTTRegion), but it is not always true, i.e. whenimport
ing the lib ES6 style and under MS Edge.In those conditions, the WebVTT parser internal
parse
method throws an exception: "Object doesn't support this operation", happening there forVTTCue
.In my scenario, I found a workaround - set VTTCue as a prop on the window object manually:
I'll be happy to submit a PR if needed.
The text was updated successfully, but these errors were encountered: