aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-10 17:36:35 +0100
committerChocobozzz <me@florianbigard.com>2018-01-10 17:36:35 +0100
commit7ae71355c40e9065f83d3fc77b6750d1929ac201 (patch)
tree54bc61cafc7ab948f396e4c7c17d669ca85e5131
parent2ccaeeb341ffe8c2609039bf4c6d8835b4650316 (diff)
downloadPeerTube-7ae71355c40e9065f83d3fc77b6750d1929ac201.tar.gz
PeerTube-7ae71355c40e9065f83d3fc77b6750d1929ac201.tar.zst
PeerTube-7ae71355c40e9065f83d3fc77b6750d1929ac201.zip
Run videojs outside angular
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts15
-rw-r--r--server/tests/api/server/handle-down.ts1
2 files changed, 9 insertions, 7 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index f02bae630..f6f043b9c 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -1,4 +1,4 @@
1import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { MetaService } from '@ngx-meta/core' 3import { MetaService } from '@ngx-meta/core'
4import { NotificationsService } from 'angular2-notifications' 4import { NotificationsService } from 'angular2-notifications'
@@ -60,7 +60,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
60 private metaService: MetaService, 60 private metaService: MetaService,
61 private authService: AuthService, 61 private authService: AuthService,
62 private notificationsService: NotificationsService, 62 private notificationsService: NotificationsService,
63 private markdownService: MarkdownService 63 private markdownService: MarkdownService,
64 private zone: NgZone
64 ) {} 65 ) {}
65 66
66 get user () { 67 get user () {
@@ -338,10 +339,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
338 this.videoPlayerLoaded = true 339 this.videoPlayerLoaded = true
339 340
340 const self = this 341 const self = this
341 videojs(this.playerElement, videojsOptions, function () { 342 this.zone.runOutsideAngular(() => {
342 self.player = this 343 videojs(this.playerElement, videojsOptions, function () {
343 this.on('customError', (event, data) => { 344 self.player = this
344 self.handleError(data.err) 345 this.on('customError', (event, data) => {
346 self.handleError(data.err)
347 })
345 }) 348 })
346 }) 349 })
347 } else { 350 } else {
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts
index da134c09f..f8ba8bd66 100644
--- a/server/tests/api/server/handle-down.ts
+++ b/server/tests/api/server/handle-down.ts
@@ -133,7 +133,6 @@ describe('Test handle downs', function () {
133 expect(videoServer2).not.to.be.undefined 133 expect(videoServer2).not.to.be.undefined
134 134
135 await completeVideoCheck(servers[1].url, videoServer2, checkAttributes) 135 await completeVideoCheck(servers[1].url, videoServer2, checkAttributes)
136
137 }) 136 })
138 137
139 after(async function () { 138 after(async function () {