import { AuthService, AuthUser, ConfirmService, MarkdownService, Notifier, RestExtractor, ServerService, UserService } from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
import { RedirectService } from '@app/core/routing/redirect.service'
-import { isXPercentInViewport, peertubeLocalStorage, scrollToTop } from '@app/helpers'
+import { isXPercentInViewport, scrollToTop } from '@app/helpers'
+import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
import { VideoShareComponent } from './modal/video-share.component'
import { VideoSupportComponent } from './modal/video-support.component'
import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
+import { VideoDownloadComponent } from '@app/shared/shared-video-miniature'
@Component({
selector: 'my-video-watch',
@ViewChild('videoShareModal') videoShareModal: VideoShareComponent
@ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent
@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
+ @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent
player: any
playerElement: HTMLVideoElement
this.completeDescriptionShown = false
}
+ showDownloadModal () {
+ this.videoDownloadModal.show(this.video, this.videoCaptions)
+ }
+
+ isVideoDownloadable () {
+ return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled
+ }
+
loadCompleteDescription () {
this.descriptionLoading = true
)
}
+ isChannelDisplayNameGeneric () {
+ const genericChannelDisplayName = [
+ `Main ${this.video.channel.ownerAccount.name} channel`,
+ `Default ${this.video.channel.ownerAccount.name} channel`
+ ]
+
+ return genericChannelDisplayName.includes(this.video.channel.displayName)
+ }
+
private loadVideo (videoId: string) {
// Video did not change
if (this.video && this.video.uuid === videoId) return