diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-17 09:20:52 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch) | |
tree | 79304b0152b0a38d33b26e65d4acdad0da4032a7 /client/src/app/+videos/+video-edit/video-add.component.ts | |
parent | 110d463fece85e87a26aca48a6048ae0017a27b3 (diff) | |
download | PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip |
Live streaming implementation first step
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-add.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-add.component.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 94e85efc1..441d5a3db 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts | |||
@@ -1,6 +1,8 @@ | |||
1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' |
2 | import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' | 2 | import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' |
3 | import { ServerConfig } from '@shared/models' | 3 | import { ServerConfig } from '@shared/models' |
4 | import { VideoEditType } from './shared/video-edit.type' | ||
5 | import { VideoGoLiveComponent } from './video-add-components/video-go-live.component' | ||
4 | import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' | 6 | import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' |
5 | import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' | 7 | import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' |
6 | import { VideoUploadComponent } from './video-add-components/video-upload.component' | 8 | import { VideoUploadComponent } from './video-add-components/video-upload.component' |
@@ -14,10 +16,11 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
14 | @ViewChild('videoUpload') videoUpload: VideoUploadComponent | 16 | @ViewChild('videoUpload') videoUpload: VideoUploadComponent |
15 | @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent | 17 | @ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent |
16 | @ViewChild('videoImportTorrent') videoImportTorrent: VideoImportTorrentComponent | 18 | @ViewChild('videoImportTorrent') videoImportTorrent: VideoImportTorrentComponent |
19 | @ViewChild('videoGoLive') videoGoLive: VideoGoLiveComponent | ||
17 | 20 | ||
18 | user: AuthUser = null | 21 | user: AuthUser = null |
19 | 22 | ||
20 | secondStepType: 'upload' | 'import-url' | 'import-torrent' | 23 | secondStepType: VideoEditType |
21 | videoName: string | 24 | videoName: string |
22 | serverConfig: ServerConfig | 25 | serverConfig: ServerConfig |
23 | 26 | ||
@@ -41,7 +44,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
41 | this.user = this.auth.getUser() | 44 | this.user = this.auth.getUser() |
42 | } | 45 | } |
43 | 46 | ||
44 | onFirstStepDone (type: 'upload' | 'import-url' | 'import-torrent', videoName: string) { | 47 | onFirstStepDone (type: VideoEditType, videoName: string) { |
45 | this.secondStepType = type | 48 | this.secondStepType = type |
46 | this.videoName = videoName | 49 | this.videoName = videoName |
47 | } | 50 | } |
@@ -62,9 +65,9 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
62 | } | 65 | } |
63 | 66 | ||
64 | canDeactivate (): { canDeactivate: boolean, text?: string} { | 67 | canDeactivate (): { canDeactivate: boolean, text?: string} { |
65 | if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate() | ||
66 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() | 68 | if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate() |
67 | if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() | 69 | if (this.secondStepType === 'import-torrent') return this.videoImportTorrent.canDeactivate() |
70 | if (this.secondStepType === 'go-live') return this.videoGoLive.canDeactivate() | ||
68 | 71 | ||
69 | return { canDeactivate: true } | 72 | return { canDeactivate: true } |
70 | } | 73 | } |
@@ -77,6 +80,10 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
77 | return this.serverConfig.import.videos.torrent.enabled | 80 | return this.serverConfig.import.videos.torrent.enabled |
78 | } | 81 | } |
79 | 82 | ||
83 | isVideoLiveEnabled () { | ||
84 | return this.serverConfig.live.enabled | ||
85 | } | ||
86 | |||
80 | isInSecondStep () { | 87 | isInSecondStep () { |
81 | return !!this.secondStepType | 88 | return !!this.secondStepType |
82 | } | 89 | } |