import { VideoSortField } from './sort-field.type'
import { Video } from './video.model'
import { ScreenService } from '@app/shared/misc/screen.service'
-import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
+import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component'
import { Syndication } from '@app/shared/video/syndication.model'
import { Notifier, ServerService } from '@app/core'
import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
syndicationItems: Syndication[] = []
loadOnInit = true
- marginContent = true
videos: Video[] = []
ownerDisplayType: OwnerDisplayType = 'account'
displayModerationBlock = false
titleTooltip: string
+ displayVideoActions = true
disabled = false
+ displayOptions: MiniatureDisplayOptions = {
+ date: true,
+ views: true,
+ by: true,
+ privacyLabel: true,
+ privacyText: false,
+ state: false,
+ blacklistInfo: false
+ }
+
protected abstract notifier: Notifier
protected abstract authService: AuthService
protected abstract route: ActivatedRoute
({ videos, totalVideos }) => {
this.pagination.totalItems = totalVideos
this.videos = this.videos.concat(videos)
+
+ this.onMoreVideos()
},
error => this.notifier.error(error.message)
throw new Error('toggleModerationDisplay is not implemented')
}
+ removeVideoFromArray (video: Video) {
+ this.videos = this.videos.filter(v => v.id !== video.id)
+ }
+
+ // On videos hook for children that want to do something
+ protected onMoreVideos () { /* empty */ }
+
protected loadRouteParams (routeParams: { [ key: string ]: any }) {
this.sort = routeParams[ 'sort' ] as VideoSortField || this.defaultSort
this.categoryOneOf = routeParams[ 'categoryOneOf' ]