Run videojs outside angular
This commit is contained in:
parent
2ccaeeb341
commit
7ae71355c4
|
@ -1,4 +1,4 @@
|
||||||
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 { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { MetaService } from '@ngx-meta/core'
|
import { MetaService } from '@ngx-meta/core'
|
||||||
import { NotificationsService } from 'angular2-notifications'
|
import { NotificationsService } from 'angular2-notifications'
|
||||||
|
@ -60,7 +60,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
private markdownService: MarkdownService
|
private markdownService: MarkdownService,
|
||||||
|
private zone: NgZone
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
get user () {
|
get user () {
|
||||||
|
@ -338,12 +339,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.videoPlayerLoaded = true
|
this.videoPlayerLoaded = true
|
||||||
|
|
||||||
const self = this
|
const self = this
|
||||||
|
this.zone.runOutsideAngular(() => {
|
||||||
videojs(this.playerElement, videojsOptions, function () {
|
videojs(this.playerElement, videojsOptions, function () {
|
||||||
self.player = this
|
self.player = this
|
||||||
this.on('customError', (event, data) => {
|
this.on('customError', (event, data) => {
|
||||||
self.handleError(data.err)
|
self.handleError(data.err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
(this.player as any).setVideoFiles(this.video.files)
|
(this.player as any).setVideoFiles(this.video.files)
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,6 @@ describe('Test handle downs', function () {
|
||||||
expect(videoServer2).not.to.be.undefined
|
expect(videoServer2).not.to.be.undefined
|
||||||
|
|
||||||
await completeVideoCheck(servers[1].url, videoServer2, checkAttributes)
|
await completeVideoCheck(servers[1].url, videoServer2, checkAttributes)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
after(async function () {
|
after(async function () {
|
||||||
|
|
Loading…
Reference in New Issue