]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-share-modal/video-share.component.ts
fix video download modal select width
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-share-modal / video-share.component.ts
index 8d8e8a3a59507df5ee4b1134fc9376e7ade1bb1b..b06ff375114dad261cb34b68a7e91d00bac66d06 100644 (file)
@@ -16,6 +16,7 @@ type Customizations = {
   subtitle: string
 
   loop: boolean
+  originUrl: boolean
   autoplay: boolean
   muted: boolean
   title: boolean
@@ -37,6 +38,7 @@ export class VideoShareComponent {
   @Input() video: VideoDetails = null
   @Input() videoCaptions: VideoCaption[] = []
   @Input() playlist: VideoPlaylist = null
+  @Input() playlistPosition: number = null
 
   activeVideoId: TabId = 'url'
   activePlaylistId: TabId = 'url'
@@ -45,8 +47,6 @@ export class VideoShareComponent {
   isAdvancedCustomizationCollapsed = true
   includeVideoInPlaylist = false
 
-  private playlistPosition: number = null
-
   constructor (private modalService: NgbModal) { }
 
   show (currentVideoTimestamp?: number, currentPlaylistPosition?: number) {
@@ -66,6 +66,7 @@ export class VideoShareComponent {
       subtitle,
 
       loop: false,
+      originUrl: false,
       autoplay: false,
       muted: false,
 
@@ -96,7 +97,8 @@ export class VideoShareComponent {
   }
 
   getVideoUrl () {
-    const baseUrl = window.location.origin + '/videos/watch/' + this.video.uuid
+    let baseUrl = this.customizations.originUrl ? this.video.originInstanceUrl : window.location.origin
+    baseUrl += '/videos/watch/' + this.video.uuid
     const options = this.getVideoOptions(baseUrl)
 
     return buildVideoLink(options)
@@ -107,7 +109,7 @@ export class VideoShareComponent {
 
     if (!this.includeVideoInPlaylist) return base
 
-    return base + '?videoId=' + this.video.uuid
+    return base + '?playlistPosition=' + this.playlistPosition
   }
 
   notSecure () {
@@ -118,6 +120,10 @@ export class VideoShareComponent {
     return this.activeVideoId === 'embed'
   }
 
+  isLocalVideo () {
+    return this.video.isLocal
+  }
+
   private getPlaylistOptions (baseUrl?: string) {
     return {
       baseUrl,