diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.scss b/client/src/app/videos/+video-watch/modal/video-share.component.scss
index c48abf9e0..8b5952da6 100644
--- a/client/src/app/videos/+video-watch/modal/video-share.component.scss
+++ b/client/src/app/videos/+video-watch/modal/video-share.component.scss
@@ -1,6 +1,18 @@
@import '_mixins';
@import '_variables';
+my-input-readonly-copy {
+ width: 100%;
+}
+
+.title-page.title-page-single {
+ margin-top: 0;
+}
+
+.playlist {
+ margin-bottom: 50px;
+}
+
.peertube-select-container {
@include peertube-select-container(200px);
}
@@ -25,10 +37,6 @@
margin-top: 20px;
}
-input.readonly {
- font-size: 15px;
-}
-
.filters {
margin-top: 30px;
padding-top: 30px;
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts
index f45afccfb..a9a7a0eab 100644
--- a/client/src/app/videos/+video-watch/modal/video-share.component.ts
+++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts
@@ -5,6 +5,7 @@ import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils
import { I18n } from '@ngx-translate/i18n-polyfill'
import { NgbModal, NgbTabChangeEvent } from '@ng-bootstrap/ng-bootstrap'
import { VideoCaption } from '@shared/models'
+import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
type Customizations = {
startAtCheckbox: boolean
@@ -34,18 +35,16 @@ export class VideoShareComponent {
@Input() video: VideoDetails = null
@Input() videoCaptions: VideoCaption[] = []
+ @Input() playlist: VideoPlaylist = null
activeId: 'url' | 'qrcode' | 'embed'
customizations: Customizations
isAdvancedCustomizationCollapsed = true
+ includeVideoInPlaylist = false
private currentVideoTimestamp: number
- constructor (
- private modalService: NgbModal,
- private notifier: Notifier,
- private i18n: I18n
- ) { }
+ constructor (private modalService: NgbModal) { }
show (currentVideoTimestamp?: number) {
this.currentVideoTimestamp = currentVideoTimestamp
@@ -86,17 +85,22 @@ export class VideoShareComponent {
}
getVideoUrl () {
- const options = this.getOptions()
+ const baseUrl = window.location.origin + '/videos/watch/' + this.video.uuid
+ const options = this.getOptions(baseUrl)
return buildVideoLink(options)
}
- notSecure () {
- return window.location.protocol === 'http:'
+ getPlaylistUrl () {
+ const base = window.location.origin + '/videos/watch/playlist/' + this.playlist.uuid
+
+ if (!this.includeVideoInPlaylist) return base
+
+ return base + '?videoId=' + this.video.uuid
}
- activateCopiedMessage () {
- this.notifier.success(this.i18n('Copied'))
+ notSecure () {
+ return window.location.protocol === 'http:'
}
onTabChange (event: NgbTabChangeEvent) {
@@ -107,6 +111,10 @@ export class VideoShareComponent {
return this.activeId === 'embed'
}
+ hasPlaylist () {
+ return !!this.playlist
+ }
+
private getOptions (baseUrl?: string) {
return {
baseUrl,
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 38ad4e948..5b2e91bc5 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.html
+++ b/client/src/app/videos/+video-watch/video-watch.component.html
@@ -224,5 +224,5 @@
-
+
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts
index 777abb568..629634985 100644
--- a/client/src/assets/player/utils.ts
+++ b/client/src/assets/player/utils.ts
@@ -51,6 +51,8 @@ function buildVideoLink (options: {
: window.location.origin + window.location.pathname.replace('/embed/', '/watch/')
const params = new URLSearchParams(window.location.search)
+ // Remove this unused parameter when we are on a playlist page
+ params.delete('videoId')
if (options.startTime) {
const startTimeInt = Math.floor(options.startTime)