]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-share-modal/video-share.component.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-share-modal / video-share.component.ts
index f57a50770a35aa62cc775569de5477b08a86d2c5..2a73e6166dd028fd532b744947024e288eda9589 100644 (file)
@@ -16,6 +16,7 @@ type Customizations = {
   subtitle: string
 
   loop: boolean
+  originUrl: boolean
   autoplay: boolean
   muted: boolean
   title: boolean
@@ -65,6 +66,7 @@ export class VideoShareComponent {
       subtitle,
 
       loop: false,
+      originUrl: false,
       autoplay: false,
       muted: false,
 
@@ -84,25 +86,26 @@ export class VideoShareComponent {
     const options = this.getVideoOptions(this.video.embedUrl)
 
     const embedUrl = buildVideoLink(options)
-    return buildVideoOrPlaylistEmbed(embedUrl)
+    return buildVideoOrPlaylistEmbed(embedUrl, this.video.name)
   }
 
   getPlaylistIframeCode () {
     const options = this.getPlaylistOptions(this.playlist.embedUrl)
 
     const embedUrl = buildPlaylistLink(options)
-    return buildVideoOrPlaylistEmbed(embedUrl)
+    return buildVideoOrPlaylistEmbed(embedUrl, this.playlist.displayName)
   }
 
   getVideoUrl () {
-    const baseUrl = window.location.origin + '/videos/watch/' + this.video.uuid
+    let baseUrl = this.customizations.originUrl ? this.video.originInstanceUrl : window.location.origin
+    baseUrl += '/w/' + this.video.uuid
     const options = this.getVideoOptions(baseUrl)
 
     return buildVideoLink(options)
   }
 
   getPlaylistUrl () {
-    const base = window.location.origin + '/videos/watch/playlist/' + this.playlist.uuid
+    const base = window.location.origin + '/w/p/' + this.playlist.uuid
 
     if (!this.includeVideoInPlaylist) return base
 
@@ -117,6 +120,10 @@ export class VideoShareComponent {
     return this.activeVideoId === 'embed'
   }
 
+  isLocalVideo () {
+    return this.video.isLocal
+  }
+
   private getPlaylistOptions (baseUrl?: string) {
     return {
       baseUrl,