aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-14 14:28:20 +0100
committerChocobozzz <me@florianbigard.com>2022-03-14 14:36:35 +0100
commit57d6503286b114fee61b5e4725825e2490dcac29 (patch)
tree2d3d23f697b2986d7e41bb443754394296b66ec3 /client/src/app/+videos
parent9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (diff)
downloadPeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.gz
PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.zst
PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.zip
Reorganize player files
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/privacy-concerns.component.ts2
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts11
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 @@
1import { truncate } from 'lodash-es' 1import { truncate } from 'lodash-es'
2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx' 2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx'
3import { isIOS } from 'src/assets/player/utils' 3import { isIOS } from '@root-helpers/web-browser'
4import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http' 4import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http'
5import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' 5import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
6import { Router } from '@angular/router' 6import { 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 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { ServerService, User, UserService } from '@app/core' 2import { ServerService, User, UserService } from '@app/core'
3import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' 3import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
4import { isP2PEnabled } from '@root-helpers/video'
4import { HTMLServerConfig, Video } from '@shared/models' 5import { HTMLServerConfig, Video } from '@shared/models'
5import { 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 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys' 1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs' 2import { forkJoin, map, Observable, of, Subscription, switchMap } from 'rxjs'
3import { isP2PEnabled } from 'src/assets/player/utils' 3import { VideoJsPlayer } from 'video.js'
4import { PlatformLocation } from '@angular/common' 4import { PlatformLocation } from '@angular/common'
5import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 5import { Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
6import { ActivatedRoute, Router } from '@angular/router' 6import { ActivatedRoute, Router } from '@angular/router'
@@ -24,6 +24,7 @@ import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/sha
24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' 24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
25import { LiveVideoService } from '@app/shared/shared-video-live' 25import { LiveVideoService } from '@app/shared/shared-video-live'
26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
27import { isP2PEnabled } from '@root-helpers/video'
27import { timeToInt } from '@shared/core-utils' 28import { timeToInt } from '@shared/core-utils'
28import { 29import {
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 }