diff options
Diffstat (limited to 'client/src/app')
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 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { switchMap } from 'rxjs/operators' | 2 | import { switchMap } from 'rxjs/operators' |
3 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' | ||
4 | import { environment } from 'src/environments/environment' | 3 | import { environment } from 'src/environments/environment' |
5 | import { Component, OnInit } from '@angular/core' | 4 | import { Component, OnInit } from '@angular/core' |
6 | import { ActivatedRoute, Router } from '@angular/router' | 5 | import { ActivatedRoute, Router } from '@angular/router' |
@@ -8,6 +7,7 @@ import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, S | |||
8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 7 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
9 | import { DropdownAction, VideoService } from '@app/shared/shared-main' | 8 | import { DropdownAction, VideoService } from '@app/shared/shared-main' |
10 | import { VideoBlockService } from '@app/shared/shared-moderation' | 9 | import { VideoBlockService } from '@app/shared/shared-moderation' |
10 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' | ||
11 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' | 11 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' |
12 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | 12 | import { 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 @@ | |||
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 | } |
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 @@ | |||
1 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' | ||
2 | import { environment } from 'src/environments/environment' | 1 | import { environment } from 'src/environments/environment' |
3 | import { Component, ElementRef, Input, OnInit } from '@angular/core' | 2 | import { Component, ElementRef, Input, OnInit } from '@angular/core' |
3 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' | ||
4 | import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils' | 4 | import { buildPlaylistEmbedLink, buildVideoEmbedLink } from '@shared/core-utils' |
5 | import { CustomMarkupComponent } from './shared' | 5 | import { 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 @@ | |||
1 | import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils' | ||
2 | import { environment } from 'src/environments/environment' | 1 | import { environment } from 'src/environments/environment' |
3 | import { Component, Input, OnInit } from '@angular/core' | 2 | import { Component, Input, OnInit } from '@angular/core' |
4 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 3 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' |
4 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' | ||
5 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' | 5 | import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils' |
6 | import { Video } from '@shared/models' | 6 | import { 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' | |||
4 | import { VideoDetails } from '@app/shared/shared-main' | 4 | import { VideoDetails } from '@app/shared/shared-main' |
5 | import { VideoPlaylist } from '@app/shared/shared-video-playlist' | 5 | import { VideoPlaylist } from '@app/shared/shared-video-playlist' |
6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
7 | import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' | ||
7 | import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils' | 8 | import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils' |
8 | import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' | 9 | import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' |
9 | import { buildVideoOrPlaylistEmbed } from '../../../assets/player/utils' | ||
10 | 10 | ||
11 | type Customizations = { | 11 | type Customizations = { |
12 | startAtCheckbox: boolean | 12 | startAtCheckbox: boolean |