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 | |
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')
-rw-r--r-- | client/src/app/shared/shared-share-modal/video-share.component.html | 30 | ||||
-rw-r--r-- | client/src/app/shared/shared-share-modal/video-share.component.ts | 25 |
2 files changed, 41 insertions, 14 deletions
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.html b/client/src/app/shared/shared-share-modal/video-share.component.html index ecd36dd5a..7ff62e128 100644 --- a/client/src/app/shared/shared-share-modal/video-share.component.html +++ b/client/src/app/shared/shared-share-modal/video-share.component.html | |||
@@ -47,7 +47,7 @@ | |||
47 | <ng-template ngbNavContent> | 47 | <ng-template ngbNavContent> |
48 | <div class="nav-content"> | 48 | <div class="nav-content"> |
49 | <my-input-toggle-hidden | 49 | <my-input-toggle-hidden |
50 | [value]="getPlaylistIframeCode()" (change)="updateEmbedCode()" | 50 | [value]="customizations.onlyEmbedUrl ? getPlaylistEmbedUrl() : getPlaylistIframeCode()" (change)="updateEmbedCode()" |
51 | [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true" | 51 | [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true" |
52 | ></my-input-toggle-hidden> | 52 | ></my-input-toggle-hidden> |
53 | 53 | ||
@@ -67,8 +67,18 @@ | |||
67 | <div class="filters"> | 67 | <div class="filters"> |
68 | 68 | ||
69 | <div class="form-group" *ngIf="video"> | 69 | <div class="form-group" *ngIf="video"> |
70 | <my-peertube-checkbox inputName="includeVideoInPlaylist" [(ngModel)]="includeVideoInPlaylist" i18n-labelText | 70 | <my-peertube-checkbox |
71 | labelText="Share the playlist at this video position"></my-peertube-checkbox> | 71 | inputName="includeVideoInPlaylist" [(ngModel)]="includeVideoInPlaylist" |
72 | i18n-labelText labelText="Share the playlist at this video position" | ||
73 | ></my-peertube-checkbox> | ||
74 | </div> | ||
75 | |||
76 | <div class="form-group"> | ||
77 | <my-peertube-checkbox | ||
78 | *ngIf="isInPlaylistEmbedTab()" | ||
79 | inputName="onlyEmbedUrl" [(ngModel)]="customizations.onlyEmbedUrl" | ||
80 | i18n-labelText labelText="Only display embed URL" | ||
81 | ></my-peertube-checkbox> | ||
72 | </div> | 82 | </div> |
73 | 83 | ||
74 | </div> | 84 | </div> |
@@ -114,7 +124,7 @@ | |||
114 | <ng-template ngbNavContent> | 124 | <ng-template ngbNavContent> |
115 | <div class="nav-content"> | 125 | <div class="nav-content"> |
116 | <my-input-toggle-hidden | 126 | <my-input-toggle-hidden |
117 | [value]="getVideoIframeCode()" (ngModelChange)="updateEmbedCode()" | 127 | [value]="customizations.onlyEmbedUrl ? getVideoEmbedUrl() : getVideoIframeCode()" (ngModelChange)="updateEmbedCode()" |
118 | [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true" | 128 | [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true" |
119 | ></my-input-toggle-hidden> | 129 | ></my-input-toggle-hidden> |
120 | 130 | ||
@@ -160,6 +170,14 @@ | |||
160 | </select> | 170 | </select> |
161 | </div> | 171 | </div> |
162 | </div> | 172 | </div> |
173 | |||
174 | <div class="form-group"> | ||
175 | <my-peertube-checkbox | ||
176 | *ngIf="isInVideoEmbedTab()" | ||
177 | inputName="onlyEmbedUrl" [(ngModel)]="customizations.onlyEmbedUrl" | ||
178 | i18n-labelText labelText="Only display embed URL" | ||
179 | ></my-peertube-checkbox> | ||
180 | </div> | ||
163 | </div> | 181 | </div> |
164 | 182 | ||
165 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> | 183 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> |
@@ -200,7 +218,7 @@ | |||
200 | ></my-peertube-checkbox> | 218 | ></my-peertube-checkbox> |
201 | </div> | 219 | </div> |
202 | 220 | ||
203 | <div *ngIf="!isLocalVideo() && !isVideoInEmbedTab()" class="form-group"> | 221 | <div *ngIf="!isLocalVideo() && !isInVideoEmbedTab()" class="form-group"> |
204 | <my-peertube-checkbox | 222 | <my-peertube-checkbox |
205 | inputName="originUrl" [(ngModel)]="customizations.originUrl" | 223 | inputName="originUrl" [(ngModel)]="customizations.originUrl" |
206 | i18n-labelText labelText="Use origin instance URL" | 224 | i18n-labelText labelText="Use origin instance URL" |
@@ -208,7 +226,7 @@ | |||
208 | </div> | 226 | </div> |
209 | </div> | 227 | </div> |
210 | 228 | ||
211 | <ng-container *ngIf="isVideoInEmbedTab()"> | 229 | <ng-container *ngIf="isInVideoEmbedTab()"> |
212 | <div class="form-group"> | 230 | <div class="form-group"> |
213 | <my-peertube-checkbox | 231 | <my-peertube-checkbox |
214 | inputName="title" [(ngModel)]="customizations.title" | 232 | inputName="title" [(ngModel)]="customizations.title" |
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 | } |