diff options
Diffstat (limited to 'client/src/app/+videos')
3 files changed, 8 insertions, 7 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index fb6f2601b..5655e48da 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { truncate } from 'lodash-es' | 1 | import { truncate } from 'lodash-es' |
2 | import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx' | 2 | import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx' |
3 | import { isIOS } from 'src/assets/player/utils' | 3 | import { isIOS } from '@root-helpers/web-browser' |
4 | import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http' | 4 | import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http' |
5 | import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' | 5 | import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' |
6 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
diff --git a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts index 24030df3e..b51457e02 100644 --- a/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts +++ b/client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { ServerService, User, UserService } from '@app/core' | 2 | import { ServerService, User, UserService } from '@app/core' |
3 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 3 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
4 | import { isP2PEnabled } from '@root-helpers/video' | ||
4 | import { HTMLServerConfig, Video } from '@shared/models' | 5 | import { HTMLServerConfig, Video } from '@shared/models' |
5 | import { isP2PEnabled } from '../../../../../assets/player/utils' | ||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-privacy-concerns', | 8 | selector: 'my-privacy-concerns', |
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 067d3bc84..f13c885f2 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | 1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' |
2 | import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs' | 2 | import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs' |
3 | import { isP2PEnabled } from 'src/assets/player/utils' | 3 | import { VideoJsPlayer } from 'video.js' |
4 | import { PlatformLocation } from '@angular/common' | 4 | import { PlatformLocation } from '@angular/common' |
5 | import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 5 | import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
6 | import { ActivatedRoute, Router } from '@angular/router' | 6 | import { ActivatedRoute, Router } from '@angular/router' |
@@ -24,6 +24,7 @@ import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/sha | |||
24 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | 24 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
25 | import { LiveVideoService } from '@app/shared/shared-video-live' | 25 | import { LiveVideoService } from '@app/shared/shared-video-live' |
26 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 26 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
27 | import { isP2PEnabled } from '@root-helpers/video' | ||
27 | import { timeToInt } from '@shared/core-utils' | 28 | import { timeToInt } from '@shared/core-utils' |
28 | import { | 29 | import { |
29 | HTMLServerConfig, | 30 | HTMLServerConfig, |
@@ -58,7 +59,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
58 | @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent | 59 | @ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent |
59 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent | 60 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent |
60 | 61 | ||
61 | player: any | 62 | player: VideoJsPlayer |
62 | playerElement: HTMLVideoElement | 63 | playerElement: HTMLVideoElement |
63 | playerPlaceholderImgSrc: string | 64 | playerPlaceholderImgSrc: string |
64 | theaterEnabled = false | 65 | theaterEnabled = false |
@@ -418,8 +419,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
418 | this.zone.runOutsideAngular(async () => { | 419 | this.zone.runOutsideAngular(async () => { |
419 | this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player) | 420 | this.player = await PeertubePlayerManager.initialize(playerMode, playerOptions, player => this.player = player) |
420 | 421 | ||
421 | this.player.on('customError', ({ err }: { err: any }) => { | 422 | this.player.on('customError', (_e, data: any) => { |
422 | this.zone.run(() => this.handleGlobalError(err)) | 423 | this.zone.run(() => this.handleGlobalError(data.err)) |
423 | }) | 424 | }) |
424 | 425 | ||
425 | this.player.on('timeupdate', () => { | 426 | this.player.on('timeupdate', () => { |
@@ -458,7 +459,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
458 | 459 | ||
459 | suspended: () => { | 460 | suspended: () => { |
460 | return ( | 461 | return ( |
461 | !isXPercentInViewport(this.player.el(), 80) || | 462 | !isXPercentInViewport(this.player.el() as HTMLElement, 80) || |
462 | !document.getElementById('content').contains(document.activeElement) | 463 | !document.getElementById('content').contains(document.activeElement) |
463 | ) | 464 | ) |
464 | } | 465 | } |