Я использую внешнюю библиотеку в своем приложении, я заметил, что, когда я меняю маршрут, возвращаюсь обратно, библиотека перестает работать.
Библиотеки импортируются так:
import videojs from "video.js"
import "videojs-markers"
....
ngOnInit() {
this.video = videojs('demo');
this.video.on('pause', function () {
this.onPauseVideo(this.video.currentTime())
}.bind(this));
this.video.on('play', function () {
this.onPlayVideo(this.video.currentTime())
}.bind(this));
this.setUpMarkers(this.video);
this.subscription = this.commentService.commentsChange.subscribe((newComments:VideoComment[])=>{
this.video.markers.add(newComments.map(el=>{
return {time:el.time,text:el.text,overlayText:el.overlayText}})
);
})
}
....
любые предложения.