diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
new file mode 100644
index 000000000..8fb244cc4
--- /dev/null
+++ b/client/src/app/+videos/+video-watch/shared/action-buttons/action-buttons.component.html
@@ -0,0 +1,85 @@
+
@@ -264,9 +187,4 @@
-
-
-
-
-
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.scss b/client/src/app/+videos/+video-watch/video-watch.component.scss
index e075fc57e..1d83fa139 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.scss
+++ b/client/src/app/+videos/+video-watch/video-watch.component.scss
@@ -151,6 +151,7 @@
@include peertube-word-wrap;
@include margin-right(30px);
+
min-height: 40px; // Align with the action buttons
font-size: 27px;
font-weight: $font-semibold;
@@ -211,106 +212,6 @@
@include margin-left(5px);
}
}
-
- .video-actions-rates {
- @include margin-left(auto);
- @include margin-right(0);
-
- margin-top: 0;
- margin-bottom: 10px;
-
- align-items: start;
- width: max-content;
-
- .video-actions {
- height: 40px; // Align with the title
- display: flex;
- align-items: center;
-
- .action-button:not(:first-child),
- .action-dropdown,
- my-video-actions-dropdown {
- @include margin-left(5px);
- }
-
- ::ng-deep.action-button {
- @include peertube-button;
- @include button-with-icon(21px, 0, -1px);
-
- font-size: 100%;
- font-weight: $font-semibold;
- display: inline-block;
- padding: 0 10px;
- white-space: nowrap;
- background-color: transparent !important;
- color: pvar(--actionButtonColor);
- text-transform: uppercase;
-
- &::after {
- display: none;
- }
-
- &:hover {
- opacity: 0.9;
- }
-
- &.action-button-support {
- color: pvar(--supportButtonColor);
-
- my-global-icon {
- @include apply-svg-color(pvar(--supportButtonColor));
- }
- }
-
- &.action-button-support {
- my-global-icon {
- ::ng-deep path:first-child {
- fill: pvar(--supportButtonHeartColor) !important;
- }
- }
- }
-
- &.action-button-save {
- my-global-icon {
- top: 0 !important;
- right: -1px;
- }
- }
-
- .icon-text {
- @include margin-left(3px);
- }
- }
- }
-
- .video-info-likes-dislikes-bar-outer-container {
- position: relative;
- }
-
- .video-info-likes-dislikes-bar-inner-container {
- position: absolute;
- height: 20px;
- }
-
- .video-info-likes-dislikes-bar {
- $likes-bar-height: 2px;
- height: $likes-bar-height;
- margin-top: -$likes-bar-height;
- width: 120px;
- background-color: #ccc;
- position: relative;
- top: 10px;
-
- .likes-bar {
- height: 100%;
- background-color: #909090;
-
- &.liked {
- background-color: pvar(--activatedActionButtonColor);
- }
- }
- }
- }
}
.video-attributes {
@@ -351,6 +252,18 @@
}
}
+my-action-buttons {
+ @include margin-left(auto);
+ @include margin-right(0);
+
+ display: block;
+ margin-top: 0;
+ margin-bottom: 10px;
+
+ align-items: start;
+ width: max-content;
+}
+
my-recommended-videos {
@include padding-left(15px);
@@ -411,10 +324,6 @@ my-video-comments {
@media screen and (max-width: 450px) {
.video-bottom {
- .action-button .icon-text {
- display: none !important;
- }
-
.video-info .video-info-first-row {
.video-info-name {
font-size: 18px;
@@ -423,12 +332,12 @@ my-video-comments {
.video-info-date-views {
font-size: 14px;
}
-
- .video-actions-rates {
- margin-top: 10px;
- }
}
}
+
+ my-action-buttons {
+ margin-top: 10px;
+ }
}
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 5a0109e64..ca20c2b85 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -18,24 +18,13 @@ import {
UserService
} from '@app/core'
import { HooksService } from '@app/core/plugins/hooks.service'
-import { RedirectService } from '@app/core/routing/redirect.service'
import { isXPercentInViewport, scrollToTop } from '@app/helpers'
import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
-import { VideoShareComponent } from '@app/shared/shared-share-modal'
-import { SupportModalComponent } from '@app/shared/shared-support-modal'
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
-import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature'
+import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
-import {
- HTMLServerConfig,
- PeerTubeProblemDocument,
- ServerErrorCode,
- UserVideoRateType,
- VideoCaption,
- VideoPrivacy,
- VideoState
-} from '@shared/models'
+import { HTMLServerConfig, PeerTubeProblemDocument, ServerErrorCode, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
import { cleanupVideoWatch, getStoredTheater, getStoredVideoWatchHistory } from '../../../assets/player/peertube-player-local-storage'
import {
CustomizationOptions,
@@ -58,10 +47,7 @@ type URLOptions = CustomizationOptions & { playerMode: PlayerMode }
})
export class VideoWatchComponent implements OnInit, OnDestroy {
@ViewChild('videoWatchPlaylist', { static: true }) videoWatchPlaylist: VideoWatchPlaylistComponent
- @ViewChild('videoShareModal') videoShareModal: VideoShareComponent
- @ViewChild('supportModal') supportModal: SupportModalComponent
@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
- @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent
player: any
playerElement: HTMLVideoElement
@@ -95,8 +81,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
liveInfo: true
}
- userRating: UserVideoRateType
-
private nextVideoUuid = ''
private nextVideoTitle = ''
private currentTime: number
@@ -124,7 +108,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
private restExtractor: RestExtractor,
private notifier: Notifier,
private zone: NgZone,
- private redirectService: RedirectService,
private videoCaptionService: VideoCaptionService,
private hotkeysService: HotkeysService,
private hooks: HooksService,
@@ -203,20 +186,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.hotkeysService.remove(this.hotkeys)
}
- showDownloadModal () {
- this.videoDownloadModal.show(this.video, this.videoCaptions)
+ getCurrentTime () {
+ return this.currentTime
}
- isVideoDownloadable () {
- return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled && !this.video.isLive
- }
-
- showSupportModal () {
- this.supportModal.show()
- }
-
- showShareModal () {
- this.videoShareModal.show(this.currentTime, this.videoWatchPlaylist.currentPlaylistPosition)
+ getCurrentPlaylistPosition () {
+ return this.videoWatchPlaylist.currentPlaylistPosition
}
isUserLoggedIn () {
@@ -245,10 +220,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
}
}
- onVideoRemoved () {
- this.redirectService.redirectToHomepage()
- }
-
isVideoToTranscode () {
return this.video && this.video.state.id === VideoState.TO_TRANSCODE
}
@@ -261,10 +232,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
return this.video && this.video.scheduledUpdate !== undefined
}
- isLive () {
- return !!(this.video?.isLive)
- }
-
isWaitingForLive () {
return this.video?.state.id === VideoState.WAITING_FOR_LIVE
}
@@ -311,11 +278,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.loadVideo(videoId)
}
- onRateUpdated (userRating: UserVideoRateType) {
- this.userRating = userRating
- this.setVideoLikesBarTooltipText()
- }
-
displayOtherVideosAsRow () {
// Use the same value as in the SASS file
return this.screenService.getWindowInnerWidth() <= 1100
@@ -421,10 +383,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
})
}
- private setVideoLikesBarTooltipText () {
- this.likesBarTooltipText = `${this.video.likes} likes / ${this.video.dislikes} dislikes`
- }
-
private handleError (err: any) {
const errorMessage: string = typeof err === 'string' ? err : err.message
if (!errorMessage) return
@@ -467,8 +425,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.buildPlayer(urlOptions)
.catch(err => console.error('Cannot build the player', err))
- this.setVideoLikesBarTooltipText()
-
this.setOpenGraphTags()
const hookOptions = {
diff --git a/client/src/app/+videos/+video-watch/video-watch.module.ts b/client/src/app/+videos/+video-watch/video-watch.module.ts
index c1f40d785..602525342 100644
--- a/client/src/app/+videos/+video-watch/video-watch.module.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.module.ts
@@ -19,6 +19,7 @@ import {
VideoDescriptionComponent,
VideoRateComponent,
VideoWatchPlaylistComponent,
+ ActionButtonsComponent,
PrivacyConcernsComponent
} from './shared'
import { VideoCommentAddComponent } from './shared/comment/video-comment-add.component'
@@ -53,6 +54,7 @@ import { VideoWatchComponent } from './video-watch.component'
VideoRateComponent,
VideoDescriptionComponent,
PrivacyConcernsComponent,
+ ActionButtonsComponent,
VideoCommentsComponent,
VideoCommentAddComponent,