aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
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
parent9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (diff)
downloadPeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.gz
PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.zst
PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.zip
Reorganize player files
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts2
-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
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts2
-rw-r--r--client/src/app/shared/shared-main/video/embed.component.ts2
-rw-r--r--client/src/app/shared/shared-share-modal/video-share.component.ts2
7 files changed, 12 insertions, 11 deletions
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index 67752c15a..033305a2b 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -1,6 +1,5 @@
1import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
2import { switchMap } from 'rxjs/operators' 2import { switchMap } from 'rxjs/operators'
3import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
4import { environment } from 'src/environments/environment' 3import { environment } from 'src/environments/environment'
5import { Component, OnInit } from '@angular/core' 4import { Component, OnInit } from '@angular/core'
6import { ActivatedRoute, Router } from '@angular/router' 5import { ActivatedRoute, Router } from '@angular/router'
@@ -8,6 +7,7 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, S
8import { AdvancedInputFilter } from '@app/shared/shared-forms' 7import { AdvancedInputFilter } from '@app/shared/shared-forms'
9import { DropdownAction, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, VideoService } from '@app/shared/shared-main'
10import { VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockService } from '@app/shared/shared-moderation'
10import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
11import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' 11import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
12import { VideoBlacklist, VideoBlacklistType } from '@shared/models' 12import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
13 13
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 }
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
index 53b70cc47..955b0af18 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/embed-markup.component.ts
@@ -1,6 +1,6 @@
1import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
2import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
3import { Component, ElementRef, Input, OnInit } from '@angular/core' 2import { Component, ElementRef, Input, OnInit } from '@angular/core'
3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils' 4import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils'
5import { CustomMarkupComponent } from './shared' 5import { CustomMarkupComponent } from './shared'
6 6
diff --git a/client/src/app/shared/shared-main/video/embed.component.ts b/client/src/app/shared/shared-main/video/embed.component.ts
index 4732efa44..123000834 100644
--- a/client/src/app/shared/shared-main/video/embed.component.ts
+++ b/client/src/app/shared/shared-main/video/embed.component.ts
@@ -1,7 +1,7 @@
1import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
2import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
3import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
4import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 3import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
4import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
5import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' 5import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
6import { Video } from '@shared/models' 6import { Video } from '@shared/models'
7 7
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts
index 36a4d7520..2346f03e4 100644
--- a/client/src/app/shared/shared-share-modal/video-share.component.ts
+++ b/client/src/app/shared/shared-share-modal/video-share.component.ts
@@ -4,9 +4,9 @@ import { ServerService } from '@app/core'
4import { VideoDetails } from '@app/shared/shared-main' 4import { VideoDetails } from '@app/shared/shared-main'
5import { VideoPlaylist } from '@app/shared/shared-video-playlist' 5import { VideoPlaylist } from '@app/shared/shared-video-playlist'
6import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
7import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils' 8import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils'
8import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' 9import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
9import { buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'
10 10
11type Customizations = { 11type Customizations = {
12 startAtCheckbox: boolean 12 startAtCheckbox: boolean