+
-
- (press Enter to add)
-
-
+
+ (press Enter to add)
+
+
-
-
-
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
index 1df9d4006..f78336fa8 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.scss
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.scss
@@ -47,6 +47,18 @@
.label-tags + span {
font-size: 15px;
}
+
+ .root-tabset /deep/ > .nav {
+ margin-left: 15px;
+ margin-bottom: 15px;
+
+ .nav-link {
+ display: flex !important;
+ align-items: center;
+ height: 30px !important;
+ padding: 0 15px !important;
+ }
+ }
}
.submit-container {
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index 2b307d5fa..85e5cc3f5 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -1,6 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
+import { VIDEO_IMAGE } from '@app/shared'
import { NotificationsService } from 'angular2-notifications'
import 'rxjs/add/observable/forkJoin'
import { ServerService } from '../../../core/server'
@@ -57,6 +58,8 @@ export class VideoEditComponent implements OnInit {
this.formErrors['licence'] = ''
this.formErrors['language'] = ''
this.formErrors['description'] = ''
+ this.formErrors['thumbnailfile'] = ''
+ this.formErrors['previewfile'] = ''
this.validationMessages['name'] = VIDEO_NAME.MESSAGES
this.validationMessages['privacy'] = VIDEO_PRIVACY.MESSAGES
@@ -65,6 +68,8 @@ export class VideoEditComponent implements OnInit {
this.validationMessages['licence'] = VIDEO_LICENCE.MESSAGES
this.validationMessages['language'] = VIDEO_LANGUAGE.MESSAGES
this.validationMessages['description'] = VIDEO_DESCRIPTION.MESSAGES
+ this.validationMessages['thumbnailfile'] = VIDEO_IMAGE.MESSAGES
+ this.validationMessages['previewfile'] = VIDEO_IMAGE.MESSAGES
this.form.addControl('name', new FormControl('', VIDEO_NAME.VALIDATORS))
this.form.addControl('privacy', new FormControl('', VIDEO_PRIVACY.VALIDATORS))
@@ -76,6 +81,8 @@ export class VideoEditComponent implements OnInit {
this.form.addControl('language', new FormControl('', VIDEO_LANGUAGE.VALIDATORS))
this.form.addControl('description', new FormControl('', VIDEO_DESCRIPTION.VALIDATORS))
this.form.addControl('tags', new FormControl(''))
+ this.form.addControl('thumbnailfile', new FormControl(''))
+ this.form.addControl('previewfile', new FormControl(''))
}
ngOnInit () {
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
index 098a71ae6..1b82281bf 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
@@ -1,4 +1,5 @@
import { NgModule } from '@angular/core'
+import { VideoImageComponent } from '@app/videos/+video-edit/shared/video-image.component'
import { TabsModule } from 'ngx-bootstrap/tabs'
import { TagInputModule } from 'ngx-chips'
import { SharedModule } from '../../../shared'
@@ -12,7 +13,8 @@ import { VideoEditComponent } from './video-edit.component'
],
declarations: [
- VideoEditComponent
+ VideoEditComponent,
+ VideoImageComponent
],
exports: [
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts
index 7f41b56d8..ad6452835 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -48,11 +48,10 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
this.buildForm()
this.serverService.videoPrivaciesLoaded
- .subscribe(
- () => this.videoPrivacies = this.serverService.getVideoPrivacies()
- )
+ .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies())
populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
+ .catch(err => console.error('Cannot populate async user video channels.', err))
const uuid: string = this.route.snapshot.params['uuid']
this.videoService.getVideo(uuid)
@@ -116,5 +115,26 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
private hydrateFormFromVideo () {
this.form.patchValue(this.video.toJSON())
+
+ const objects = [
+ {
+ url: 'thumbnailUrl',
+ name: 'thumbnailfile'
+ },
+ {
+ url: 'previewUrl',
+ name: 'previewfile'
+ }
+ ]
+
+ for (const obj of objects) {
+ fetch(this.video[obj.url])
+ .then(response => response.blob())
+ .then(data => {
+ this.form.patchValue({
+ [ obj.name ]: data
+ })
+ })
+ }
}
}
diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html
index af90e22a1..8c173d6b3 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.html
+++ b/client/src/app/videos/+video-watch/video-watch.component.html
@@ -1,7 +1,7 @@
-
+
Video not found :'(
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 7a64406e6..7c97f0964 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -211,6 +211,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
return Account.GET_ACCOUNT_AVATAR_URL(this.video.account)
}
+ getVideoPoster () {
+ if (!this.video) return ''
+
+ return this.video.previewUrl
+ }
+
getVideoTags () {
if (!this.video || Array.isArray(this.video.tags) === false) return []
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index 340221002..80dd3408f 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -299,35 +299,46 @@ p-datatable {
}
}
-.nav {
- font-size: 16px !important;
- border: none !important;
-
- .nav-item .nav-link {
- margin-right: 30px;
- padding: 0;
- border-radius: 3px;
+tabset:not(.bootstrap) {
+ .nav {
+ font-size: 16px !important;
border: none !important;
- .tab-link {
- display: flex !important;
- align-items: center;
- min-height: 30px !important;
- padding: 0 15px;
- }
+ .nav-item .nav-link {
+ margin-right: 30px;
+ padding: 0;
+ border-radius: 3px;
+ border: none !important;
+ .tab-link {
+ display: flex !important;
+ align-items: center;
+ min-height: 30px !important;
+ padding: 0 15px;
+ }
+
+ &, & a {
+ color: #000 !important;
+ @include disable-default-a-behaviour;
+ }
+
+ &.active, &:hover {
+ background-color: #F0F0F0;
+ }
+
+ &.active {
+ font-weight: $font-semibold !important;
+ }
+ }
+ }
+}
+
+tabset.bootstrap {
+ .nav-item .nav-link {
&, & a {
- color: #000 !important;
+ color: #000;
@include disable-default-a-behaviour;
}
-
- &.active, &:hover {
- background-color: #F0F0F0;
- }
-
- &.active {
- font-weight: $font-semibold !important;
- }
}
}
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 89163edb3..532afb8c0 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -61,6 +61,12 @@ async function getConfig (req: express.Request, res: express.Response, next: exp
}
},
video: {
+ image: {
+ extensions: CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME,
+ size: {
+ max: CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max
+ }
+ },
file: {
extensions: CONSTRAINTS_FIELDS.VIDEOS.EXTNAME
}
diff --git a/shared/models/config/server-config.model.ts b/shared/models/config/server-config.model.ts
index fdc36bcc1..988dd71e3 100644
--- a/shared/models/config/server-config.model.ts
+++ b/shared/models/config/server-config.model.ts
@@ -23,6 +23,12 @@ export interface ServerConfig {
}
video: {
+ image: {
+ size: {
+ max: number
+ }
+ extensions: string[]
+ },
file: {
extensions: string[]
}
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts
index 0b26484d7..b281ace9a 100644
--- a/shared/models/videos/video-update.model.ts
+++ b/shared/models/videos/video-update.model.ts
@@ -11,4 +11,6 @@ export interface VideoUpdate {
tags?: string[]
commentsEnabled?: boolean
nsfw?: boolean
+ thumbnailfile?: Blob
+ previewfile?: Blob
}