We are using the video.js Player in combination with an angular-cli project. By the addRemoteTextTrack method of the player, I add subtitles to the video.
this.vjsPlayer.addRemoteTextTrack({
kind: '/path/to/file.vtt',
label: 'Test',
src
}, true);
This works great when I麓m in the development mode of the project. But when I uglify the code by angular-cli by the command ng build --prod, the subtitles will not update anymore. What I mean is, that it stays on the subtitle text when you have activated the subtitles but the text does not get updated.
Most of the time I use Chrome for development but this happens in every browser.
@angular/cli": "1.7.4"@angular/core": "5.2.10"Looking at the cli, not really sure what's wrong. Would you be able to make a simple page with Video.js and upload it somewhere?
If we get a reduced test case, we'll be able to take a look.
@gkatsev We have the same bug. It's because of this.activeCues https://github.com/videojs/video.js/blob/4d3331e3be17198d9e0eefab29d06134928de5d8/src/js/tracks/text-track.js#L181 that is removed by uglify.
@Chocobozzz interesting, do you know which rule removes that?
@gkatsev Yes, it's the pure_getters rule https://github.com/mishoo/UglifyJS2/#compress-options
Unfortunately we cannot change this rule in angular-cli...
An easy fix would be to change the line to this.activeCues = this.activeCues since the activeCues setter has no effect.
@Chocobozzz seems like that should work, would you be interested in making a PR for that?
Thanks @Chocobozzz! I plan on doing a release of Video.js today, so, it should go out then.
Yeah! Thanks @gkatsev, it's really a pleasure to have a module with a great support, that releases a fixed version just a few hours later. :kissing_heart:
Applying this fix this.activeCues = this.activeCues in an older version (5.8.0) also addresses this bug. Thank you @Chocobozzz
Most helpful comment
Yeah! Thanks @gkatsev, it's really a pleasure to have a module with a great support, that releases a fixed version just a few hours later. :kissing_heart: