SunnyLi / videojs-ass

Advanced SubStation Alpha subtitle plugin for videojs
https://sunnyli.github.io/videojs-ass/example.html
Other
91 stars 22 forks source link

Videojs Caption Selection #21

Open dregulae opened 7 years ago

dregulae commented 7 years ago

Latest version of videojs some reason videojs-ass has stopped working with an error.

Uncaught (in promise) TypeError: Cannot read property 'srclang' of undefined

SunnyLi commented 7 years ago

Hi, Apology for the late response.

I haven't taken a good look at this issue yet, but I believe you can bypass the problem if you use v0.7.0 (4548378156565f230f6f1c64fa7b20a65baa363d) of videojs-ass instead of the current version v0.8.0.

Alternatively, found this pretty good fork which may have fixed the problem..

DoomTay commented 6 years ago

Sounds like what's happening is you need to define a srcLang for your subtitles, like so

var vjs_ass = vjs.ass({
        'src': ["subs/os.ass"],
        label: "engsub",
        srclang: "en",
        videoWidth: 640,
        videoHeight: 360,
        // enableSvg: false
      });

The docs and example URL need to be updated

But apart from that, I kinda agree that that branch handles things more intuitively than this one, with a srclang for each track and all that. The downside is that it seems to require a rather late version of video.js. That said, I'd rather features from those integrated into this branch.