diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-20 09:07:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-20 09:07:00 +0200 |
commit | a871d2a27324defde9a9ee6a998907886715f18e (patch) | |
tree | 667ef88904ab23864df10bf663c9848707a785dd /client/src/app/shared/shared-share-modal/video-share.component.ts | |
parent | 6b3aa06804e12dc01c1f31fe2d03ae4b8cb01cd1 (diff) | |
download | PeerTube-a871d2a27324defde9a9ee6a998907886715f18e.tar.gz PeerTube-a871d2a27324defde9a9ee6a998907886715f18e.tar.zst PeerTube-a871d2a27324defde9a9ee6a998907886715f18e.zip |
Add "only display embed URL" in share modal
Diffstat (limited to 'client/src/app/shared/shared-share-modal/video-share.component.ts')
-rw-r--r-- | client/src/app/shared/shared-share-modal/video-share.component.ts | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts index 2346f03e4..6c0d4a039 100644 --- a/client/src/app/shared/shared-share-modal/video-share.component.ts +++ b/client/src/app/shared/shared-share-modal/video-share.component.ts | |||
@@ -24,6 +24,7 @@ type Customizations = { | |||
24 | muted: boolean | 24 | muted: boolean |
25 | 25 | ||
26 | embedP2P: boolean | 26 | embedP2P: boolean |
27 | onlyEmbedUrl: boolean | ||
27 | title: boolean | 28 | title: boolean |
28 | warningTitle: boolean | 29 | warningTitle: boolean |
29 | controls: boolean | 30 | controls: boolean |
@@ -82,9 +83,9 @@ export class VideoShareComponent { | |||
82 | autoplay: false, | 83 | autoplay: false, |
83 | muted: false, | 84 | muted: false, |
84 | 85 | ||
85 | embedP2P: this.server.getHTMLConfig().defaults.p2p.embed.enabled, | ||
86 | |||
87 | // Embed options | 86 | // Embed options |
87 | embedP2P: this.server.getHTMLConfig().defaults.p2p.embed.enabled, | ||
88 | onlyEmbedUrl: false, | ||
88 | title: true, | 89 | title: true, |
89 | warningTitle: true, | 90 | warningTitle: true, |
90 | controls: true, | 91 | controls: true, |
@@ -112,15 +113,19 @@ export class VideoShareComponent { | |||
112 | } | 113 | } |
113 | 114 | ||
114 | getVideoIframeCode () { | 115 | getVideoIframeCode () { |
115 | const embedUrl = decorateVideoLink({ url: this.video.embedUrl, ...this.getVideoOptions(true) }) | 116 | return buildVideoOrPlaylistEmbed(this.getVideoEmbedUrl(), this.video.name) |
117 | } | ||
116 | 118 | ||
117 | return buildVideoOrPlaylistEmbed(embedUrl, this.video.name) | 119 | getVideoEmbedUrl () { |
120 | return decorateVideoLink({ url: this.video.embedUrl, ...this.getVideoOptions(true) }) | ||
118 | } | 121 | } |
119 | 122 | ||
120 | getPlaylistIframeCode () { | 123 | getPlaylistEmbedUrl () { |
121 | const embedUrl = decoratePlaylistLink({ url: this.playlist.embedUrl, ...this.getPlaylistOptions() }) | 124 | return decoratePlaylistLink({ url: this.playlist.embedUrl, ...this.getPlaylistOptions() }) |
125 | } | ||
122 | 126 | ||
123 | return buildVideoOrPlaylistEmbed(embedUrl, this.playlist.displayName) | 127 | getPlaylistIframeCode () { |
128 | return buildVideoOrPlaylistEmbed(this.getPlaylistEmbedUrl(), this.playlist.displayName) | ||
124 | } | 129 | } |
125 | 130 | ||
126 | getVideoUrl () { | 131 | getVideoUrl () { |
@@ -152,10 +157,14 @@ export class VideoShareComponent { | |||
152 | return window.location.protocol === 'http:' | 157 | return window.location.protocol === 'http:' |
153 | } | 158 | } |
154 | 159 | ||
155 | isVideoInEmbedTab () { | 160 | isInVideoEmbedTab () { |
156 | return this.activeVideoId === 'embed' | 161 | return this.activeVideoId === 'embed' |
157 | } | 162 | } |
158 | 163 | ||
164 | isInPlaylistEmbedTab () { | ||
165 | return this.activePlaylistId === 'embed' | ||
166 | } | ||
167 | |||
159 | isLocalVideo () { | 168 | isLocalVideo () { |
160 | return this.video.isLocal | 169 | return this.video.isLocal |
161 | } | 170 | } |