-import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'
+import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { MetaService } from '@ngx-meta/core'
import { NotificationsService } from 'angular2-notifications'
private metaService: MetaService,
private authService: AuthService,
private notificationsService: NotificationsService,
- private markdownService: MarkdownService
+ private markdownService: MarkdownService,
+ private zone: NgZone
) {}
get user () {
this.videoPlayerLoaded = true
const self = this
- videojs(this.playerElement, videojsOptions, function () {
- self.player = this
- this.on('customError', (event, data) => {
- self.handleError(data.err)
+ this.zone.runOutsideAngular(() => {
+ videojs(this.playerElement, videojsOptions, function () {
+ self.player = this
+ this.on('customError', (event, data) => {
+ self.handleError(data.err)
+ })
})
})
} else {