- getVideoUrl () {
- if (!this.video.url) {
- return this.video.originInstanceUrl + VideoDetails.buildClientUrl(this.video.uuid)
- }
- return this.video.url
- }
-
- getVideoTags () {
- if (!this.video || Array.isArray(this.video.tags) === false) return []
-
- return this.video.tags
- }
-
- onRecommendations (videos: Video[]) {
- if (videos.length > 0) {
- // The recommended videos's first element should be the next video
- const video = videos[0]
- this.nextVideoUuid = video.uuid
- this.nextVideoTitle = video.name
- }
- }
-
- onVideoRemoved () {
- this.redirectService.redirectToHomepage()
- }
-
- declinedPrivacyConcern () {
- peertubeLocalStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'false')
- this.hasAlreadyAcceptedPrivacyConcern = false
- }
-
- acceptedPrivacyConcern () {
- peertubeLocalStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
- this.hasAlreadyAcceptedPrivacyConcern = true
- }
-
- isVideoToTranscode () {
- return this.video && this.video.state.id === VideoState.TO_TRANSCODE
- }
-
- isVideoToImport () {
- return this.video && this.video.state.id === VideoState.TO_IMPORT
- }
-
- hasVideoScheduledPublication () {
- return this.video && this.video.scheduledUpdate !== undefined
- }
-
- isLive () {
- return !!(this.video?.isLive)
- }
-
- isWaitingForLive () {
- return this.video?.state.id === VideoState.WAITING_FOR_LIVE
- }
-
- isLiveEnded () {
- return this.video?.state.id === VideoState.LIVE_ENDED
- }
-