aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-add.component.ts15
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts4
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.ts14
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.model.ts7
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.service.ts17
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.ts21
-rw-r--r--client/src/app/videos/+video-watch/modal/video-share.component.ts8
-rw-r--r--client/src/app/videos/+video-watch/modal/video-support.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts39
-rw-r--r--client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts28
-rw-r--r--client/src/app/videos/+video-watch/video-watch-playlist.component.ts13
-rw-r--r--client/src/app/videos/+video-watch/video-watch-routing.module.ts2
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts42
-rw-r--r--client/src/app/videos/+video-watch/video-watch.module.ts34
14 files changed, 148 insertions, 100 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
index e1a8f6260..79505c779 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
@@ -1,16 +1,13 @@
1import { Observable } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { Router } from '@angular/router' 3import { Router } from '@angular/router'
3import { Notifier } from '@app/core' 4import { Notifier, User } from '@app/core'
4import { Observable } from 'rxjs' 5import { FormReactive, FormValidatorService, VideoCommentValidatorsService } from '@app/shared/shared-forms'
5import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 6import { Video } from '@app/shared/shared-main'
6import { FormReactive } from '../../../shared' 7import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { User } from '../../../shared/users' 8import { VideoCommentCreate } from '@shared/models'
8import { Video } from '../../../shared/video/video.model'
9import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
10import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
11import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
12import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service'
13import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
14 11
15@Component({ 12@Component({
16 selector: 'my-video-comment-add', 13 selector: 'my-video-comment-add',
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
index 1566d7369..7c2aaeadd 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
@@ -1,5 +1,5 @@
1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '../../../../../../shared/models/videos/video-comment.model' 1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '@shared/models'
2import { VideoComment } from '@app/videos/+video-watch/comment/video-comment.model' 2import { VideoComment } from './video-comment.model'
3 3
4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel { 4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel {
5 comment: VideoComment 5 comment: VideoComment
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
index 868addd58..27846c1ad 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
@@ -1,15 +1,10 @@
1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
2import { User, UserRight } from '../../../../../../shared/models/users' 2import { MarkdownService, Notifier, UserService } from '@app/core'
3import { AuthService } from '@app/core/auth' 3import { AuthService } from '@app/core/auth'
4import { AccountService } from '@app/shared/account/account.service' 4import { Account, Actor, Video } from '@app/shared/shared-main'
5import { Video } from '@app/shared/video/video.model' 5import { User, UserRight } from '@shared/models'
6import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
6import { VideoComment } from './video-comment.model' 7import { VideoComment } from './video-comment.model'
7import { MarkdownService } from '@app/shared/renderer'
8import { Account } from '@app/shared/account/account.model'
9import { Notifier } from '@app/core'
10import { UserService } from '@app/shared'
11import { Actor } from '@app/shared/actor/actor.model'
12import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
13 8
14@Component({ 9@Component({
15 selector: 'my-video-comment', 10 selector: 'my-video-comment',
@@ -40,7 +35,6 @@ export class VideoCommentComponent implements OnInit, OnChanges {
40 constructor ( 35 constructor (
41 private markdownService: MarkdownService, 36 private markdownService: MarkdownService,
42 private authService: AuthService, 37 private authService: AuthService,
43 private accountService: AccountService,
44 private userService: UserService, 38 private userService: UserService,
45 private notifier: Notifier 39 private notifier: Notifier
46 ) {} 40 ) {}
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
index 171fc4acc..e85443196 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
@@ -1,7 +1,6 @@
1import { Account as AccountInterface } from '../../../../../../shared/models/actors' 1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { VideoComment as VideoCommentServerModel, VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 2import { Actor } from '@app/shared/shared-main'
3import { Actor } from '@app/shared/actor/actor.model' 3import { Account as AccountInterface, VideoComment as VideoCommentServerModel } from '@shared/models'
4import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
5 4
6export class VideoComment implements VideoCommentServerModel { 5export class VideoComment implements VideoCommentServerModel {
7 id: number 6 id: number
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
index 0b0715390..a73fb9ca8 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
@@ -1,20 +1,19 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { objectLineFeedToHtml } from '@app/shared/misc/utils' 5import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
5import { Observable } from 'rxjs' 6import { objectLineFeedToHtml } from '@app/helpers'
6import { FeedFormat, ResultList } from '../../../../../../shared/models'
7import { 7import {
8 FeedFormat,
9 ResultList,
8 VideoComment as VideoCommentServerModel, 10 VideoComment as VideoCommentServerModel,
9 VideoCommentCreate, 11 VideoCommentCreate,
10 VideoCommentThreadTree as VideoCommentThreadTreeServerModel 12 VideoCommentThreadTree as VideoCommentThreadTreeServerModel
11} from '../../../../../../shared/models/videos/video-comment.model' 13} from '@shared/models'
12import { environment } from '../../../../environments/environment' 14import { environment } from '../../../../environments/environment'
13import { RestExtractor, RestService } from '../../../shared/rest' 15import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
14import { ComponentPaginationLight } from '../../../shared/rest/component-pagination.model'
15import { CommentSortField } from '../../../shared/video/sort-field.type'
16import { VideoComment } from './video-comment.model' 16import { VideoComment } from './video-comment.model'
17import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
18 17
19@Injectable() 18@Injectable()
20export class VideoCommentService { 19export class VideoCommentService {
@@ -52,7 +51,7 @@ export class VideoCommentService {
52 getVideoCommentThreads (parameters: { 51 getVideoCommentThreads (parameters: {
53 videoId: number | string, 52 videoId: number | string,
54 componentPagination: ComponentPaginationLight, 53 componentPagination: ComponentPaginationLight,
55 sort: CommentSortField 54 sort: string
56 }): Observable<ResultList<VideoComment>> { 55 }): Observable<ResultList<VideoComment>> {
57 const { videoId, componentPagination, sort } = parameters 56 const { videoId, componentPagination, sort } = parameters
58 57
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
index bba9f1372..df0018ec6 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
@@ -1,18 +1,13 @@
1import { Subject, Subscription } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 3import { ActivatedRoute } from '@angular/router'
3import { ConfirmService, Notifier } from '@app/core' 4import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifier, User } from '@app/core'
4import { Subject, Subscription } from 'rxjs' 5import { HooksService } from '@app/core/plugins/hooks.service'
5import { AuthService } from '../../../core/auth' 6import { Syndication, VideoDetails } from '@app/shared/shared-main'
6import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' 7import { I18n } from '@ngx-translate/i18n-polyfill'
7import { User } from '../../../shared/users' 8import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
8import { CommentSortField } from '../../../shared/video/sort-field.type'
9import { VideoDetails } from '../../../shared/video/video-details.model'
10import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
11import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
12import { I18n } from '@ngx-translate/i18n-polyfill'
13import { Syndication } from '@app/shared/video/syndication.model'
14import { HooksService } from '@app/core/plugins/hooks.service'
15import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
16 11
17@Component({ 12@Component({
18 selector: 'my-video-comments', 13 selector: 'my-video-comments',
@@ -28,7 +23,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
28 23
29 comments: VideoComment[] = [] 24 comments: VideoComment[] = []
30 highlightedThread: VideoComment 25 highlightedThread: VideoComment
31 sort: CommentSortField = '-createdAt' 26 sort = '-createdAt'
32 componentPagination: ComponentPagination = { 27 componentPagination: ComponentPagination = {
33 currentPage: 1, 28 currentPage: 1,
34 itemsPerPage: 10, 29 itemsPerPage: 10,
@@ -154,7 +149,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
154 this.viewReplies(commentTree.comment.id) 149 this.viewReplies(commentTree.comment.id)
155 } 150 }
156 151
157 handleSortChange (sort: CommentSortField) { 152 handleSortChange (sort: string) {
158 if (this.sort === sort) return 153 if (this.sort === sort) return
159 154
160 this.sort = sort 155 this.sort = sort
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts
index 3550556a0..b42b775c1 100644
--- a/client/src/app/videos/+video-watch/modal/video-share.component.ts
+++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, Input, ViewChild } from '@angular/core' 1import { Component, ElementRef, Input, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model'
3import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils' 2import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { VideoCaption } from '@shared/models' 4import { VideoCaption } from '@shared/models'
6import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 5import { VideoDetails } from '@app/shared/shared-main'
6import { VideoPlaylist } from '@app/shared/shared-video-playlist'
7 7
8type Customizations = { 8type Customizations = {
9 startAtCheckbox: boolean 9 startAtCheckbox: boolean
@@ -40,13 +40,9 @@ export class VideoShareComponent {
40 isAdvancedCustomizationCollapsed = true 40 isAdvancedCustomizationCollapsed = true
41 includeVideoInPlaylist = false 41 includeVideoInPlaylist = false
42 42
43 private currentVideoTimestamp: number
44
45 constructor (private modalService: NgbModal) { } 43 constructor (private modalService: NgbModal) { }
46 44
47 show (currentVideoTimestamp?: number) { 45 show (currentVideoTimestamp?: number) {
48 this.currentVideoTimestamp = currentVideoTimestamp
49
50 let subtitle: string 46 let subtitle: string
51 if (this.videoCaptions.length !== 0) { 47 if (this.videoCaptions.length !== 0) {
52 subtitle = this.videoCaptions[0].language.id 48 subtitle = this.videoCaptions[0].language.id
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts
index 0058172f2..48d5f2948 100644
--- a/client/src/app/videos/+video-watch/modal/video-support.component.ts
+++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts
@@ -1,7 +1,7 @@
1import { Component, Input, ViewChild } from '@angular/core' 1import { Component, Input, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model' 2import { MarkdownService } from '@app/core'
3import { VideoDetails } from '@app/shared/shared-main'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { MarkdownService } from '@app/shared/renderer'
5 5
6@Component({ 6@Component({
7 selector: 'my-video-support', 7 selector: 'my-video-support',
diff --git a/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts
new file mode 100644
index 000000000..45e023695
--- /dev/null
+++ b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts
@@ -0,0 +1,39 @@
1import { Directive, EventEmitter, HostListener, Output } from '@angular/core'
2
3@Directive({
4 selector: '[timestampRouteTransformer]'
5})
6export class TimestampRouteTransformerDirective {
7 @Output() timestampClicked = new EventEmitter<number>()
8
9 @HostListener('click', ['$event'])
10 public onClick ($event: Event) {
11 const target = $event.target as HTMLLinkElement
12
13 if (target.hasAttribute('href') !== true) return
14
15 const ngxLink = document.createElement('a')
16 ngxLink.href = target.getAttribute('href')
17
18 // we only care about reflective links
19 if (ngxLink.host !== window.location.host) return
20
21 const ngxLinkParams = new URLSearchParams(ngxLink.search)
22 if (ngxLinkParams.has('start') !== true) return
23
24 const separators = ['h', 'm', 's']
25 const start = ngxLinkParams
26 .get('start')
27 .match(new RegExp('(\\d{1,9}[' + separators.join('') + '])','g')) // match digits before any given separator
28 .map(t => {
29 if (t.includes('h')) return parseInt(t, 10) * 3600
30 if (t.includes('m')) return parseInt(t, 10) * 60
31 return parseInt(t, 10)
32 })
33 .reduce((acc, t) => acc + t)
34
35 this.timestampClicked.emit(start)
36
37 $event.preventDefault()
38 }
39}
diff --git a/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts
new file mode 100644
index 000000000..4b6767415
--- /dev/null
+++ b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts
@@ -0,0 +1,28 @@
1import { Pipe, PipeTransform } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill'
3
4@Pipe({
5 name: 'myVideoDurationFormatter'
6})
7export class VideoDurationPipe implements PipeTransform {
8
9 constructor (private i18n: I18n) {
10
11 }
12
13 transform (value: number): string {
14 const hours = Math.floor(value / 3600)
15 const minutes = Math.floor((value % 3600) / 60)
16 const seconds = value % 60
17
18 if (hours > 0) {
19 return this.i18n('{{hours}} h {{minutes}} min {{seconds}} sec', { hours, minutes, seconds })
20 }
21
22 if (minutes > 0) {
23 return this.i18n('{{minutes}} min {{seconds}} sec', { minutes, seconds })
24 }
25
26 return this.i18n('{{seconds}} sec', { seconds })
27 }
28}
diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
index 827c34d41..2c21be643 100644
--- a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
@@ -1,15 +1,10 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
3import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
4import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models'
5import { Router } from '@angular/router' 2import { Router } from '@angular/router'
6import { UserService } from '@app/shared' 3import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core'
7import { AuthService, Notifier } from '@app/core' 4import { peertubeLocalStorage, peertubeSessionStorage } from '@app/helpers/peertube-web-storage'
8import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' 5import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
9import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model'
10import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage'
11import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
12import { SessionStorageService, LocalStorageService } from '@app/shared/misc/storage.service' 7import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models'
13 8
14@Component({ 9@Component({
15 selector: 'my-video-watch-playlist', 10 selector: 'my-video-watch-playlist',
diff --git a/client/src/app/videos/+video-watch/video-watch-routing.module.ts b/client/src/app/videos/+video-watch/video-watch-routing.module.ts
index ce9250bdc..d8fecb87d 100644
--- a/client/src/app/videos/+video-watch/video-watch-routing.module.ts
+++ b/client/src/app/videos/+video-watch/video-watch-routing.module.ts
@@ -1,8 +1,6 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3
4import { MetaGuard } from '@ngx-meta/core' 3import { MetaGuard } from '@ngx-meta/core'
5
6import { VideoWatchComponent } from './video-watch.component' 4import { VideoWatchComponent } from './video-watch.component'
7 5
8const videoWatchRoutes: Routes = [ 6const videoWatchRoutes: Routes = [
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 df0c1058c..5b0b34c80 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -1,41 +1,33 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { forkJoin, Observable, Subscription } from 'rxjs'
1import { catchError } from 'rxjs/operators' 3import { catchError } from 'rxjs/operators'
4import { PlatformLocation } from '@angular/common'
2import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 5import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 6import { ActivatedRoute, Router } from '@angular/router'
7import { AuthService, AuthUser, ConfirmService, MarkdownService, Notifier, RestExtractor, ServerService, UserService } from '@app/core'
8import { HooksService } from '@app/core/plugins/hooks.service'
4import { RedirectService } from '@app/core/routing/redirect.service' 9import { RedirectService } from '@app/core/routing/redirect.service'
5import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 10import { isXPercentInViewport, peertubeLocalStorage, scrollToTop } from '@app/helpers'
6import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 11import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
12import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
13import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
7import { MetaService } from '@ngx-meta/core' 14import { MetaService } from '@ngx-meta/core'
8import { AuthUser, Notifier, ServerService } from '@app/core'
9import { forkJoin, Observable, Subscription } from 'rxjs'
10import { Hotkey, HotkeysService } from 'angular2-hotkeys'
11import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared'
12import { AuthService, ConfirmService } from '../../core'
13import { RestExtractor, UserService } from '../../shared'
14import { VideoDetails } from '../../shared/video/video-details.model'
15import { VideoService } from '../../shared/video/video.service'
16import { VideoShareComponent } from './modal/video-share.component'
17import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
18import { I18n } from '@ngx-translate/i18n-polyfill' 15import { I18n } from '@ngx-translate/i18n-polyfill'
19import { environment } from '../../../environments/environment' 16import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
20import { VideoCaptionService } from '@app/shared/video-caption' 17import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage'
21import { MarkdownService } from '@app/shared/renderer'
22import { 18import {
23 videojs,
24 CustomizationOptions, 19 CustomizationOptions,
25 P2PMediaLoaderOptions, 20 P2PMediaLoaderOptions,
26 PeertubePlayerManager, 21 PeertubePlayerManager,
27 PeertubePlayerManagerOptions, 22 PeertubePlayerManagerOptions,
28 PlayerMode 23 PlayerMode,
24 videojs
29} from '../../../assets/player/peertube-player-manager' 25} from '../../../assets/player/peertube-player-manager'
30import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
31import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
32import { Video } from '@app/shared/video/video.model'
33import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' 26import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils'
34import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' 27import { environment } from '../../../environments/environment'
35import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' 28import { VideoShareComponent } from './modal/video-share.component'
36import { HooksService } from '@app/core/plugins/hooks.service' 29import { VideoSupportComponent } from './modal/video-support.component'
37import { PlatformLocation } from '@angular/common' 30import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
38import { scrollToTop, isXPercentInViewport } from '@app/shared/misc/utils'
39 31
40@Component({ 32@Component({
41 selector: 'my-video-watch', 33 selector: 'my-video-watch',
diff --git a/client/src/app/videos/+video-watch/video-watch.module.ts b/client/src/app/videos/+video-watch/video-watch.module.ts
index 9b445269d..a1c54f065 100644
--- a/client/src/app/videos/+video-watch/video-watch.module.ts
+++ b/client/src/app/videos/+video-watch/video-watch.module.ts
@@ -1,26 +1,40 @@
1import { QRCodeModule } from 'angularx-qrcode'
1import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
2import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 3import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedModule } from '../../shared' 4import { SharedGlobalIconModule } from '@app/shared/shared-icons'
5import { SharedMainModule } from '@app/shared/shared-main'
6import { SharedModerationModule } from '@app/shared/shared-moderation'
7import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
8import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
9import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
10import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module'
11import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
4import { VideoCommentAddComponent } from './comment/video-comment-add.component' 12import { VideoCommentAddComponent } from './comment/video-comment-add.component'
5import { VideoCommentComponent } from './comment/video-comment.component' 13import { VideoCommentComponent } from './comment/video-comment.component'
6import { VideoCommentService } from './comment/video-comment.service' 14import { VideoCommentService } from './comment/video-comment.service'
7import { VideoCommentsComponent } from './comment/video-comments.component' 15import { VideoCommentsComponent } from './comment/video-comments.component'
8import { VideoShareComponent } from './modal/video-share.component' 16import { VideoShareComponent } from './modal/video-share.component'
17import { VideoSupportComponent } from './modal/video-support.component'
18import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive'
19import { VideoDurationPipe } from './video-duration-formatter.pipe'
20import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
9import { VideoWatchRoutingModule } from './video-watch-routing.module' 21import { VideoWatchRoutingModule } from './video-watch-routing.module'
10import { VideoWatchComponent } from './video-watch.component' 22import { VideoWatchComponent } from './video-watch.component'
11import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
12import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module'
13import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component'
14import { QRCodeModule } from 'angularx-qrcode'
15import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestamp-route-transformer.directive'
16 23
17@NgModule({ 24@NgModule({
18 imports: [ 25 imports: [
19 VideoWatchRoutingModule, 26 VideoWatchRoutingModule,
20 SharedModule,
21 NgbTooltipModule, 27 NgbTooltipModule,
22 QRCodeModule, 28 QRCodeModule,
23 RecommendationsModule 29 RecommendationsModule,
30
31 SharedMainModule,
32 SharedFormModule,
33 SharedVideoMiniatureModule,
34 SharedVideoPlaylistModule,
35 SharedUserSubscriptionModule,
36 SharedModerationModule,
37 SharedGlobalIconModule
24 ], 38 ],
25 39
26 declarations: [ 40 declarations: [
@@ -33,6 +47,8 @@ import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestam
33 VideoCommentAddComponent, 47 VideoCommentAddComponent,
34 VideoCommentComponent, 48 VideoCommentComponent,
35 49
50 TimestampRouteTransformerDirective,
51 VideoDurationPipe,
36 TimestampRouteTransformerDirective 52 TimestampRouteTransformerDirective
37 ], 53 ],
38 54