diff options
author | Thavarasa Prasanth <45243326+pthavarasa@users.noreply.github.com> | 2021-03-31 08:32:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 08:32:05 +0200 |
commit | 4097c6d66cb2919c28b5bce44b259e630923fbe0 (patch) | |
tree | d57897b0b8762202a0be90388e9a79153690b9d9 /client/src/assets/player/peertube-player-manager.ts | |
parent | 47099aba46be7757d833422f1706b99a3c0e28ea (diff) | |
download | PeerTube-4097c6d66cb2919c28b5bce44b259e630923fbe0.tar.gz PeerTube-4097c6d66cb2919c28b5bce44b259e630923fbe0.tar.zst PeerTube-4097c6d66cb2919c28b5bce44b259e630923fbe0.zip |
fix missing title attribute on <iframe> tag suggested for embedding (#3901)
* title attribute is missing on <iframe> tag suggested for embedding #3861
* fix #3901
* fix: escapeHTML #3901
* fix: playlist title instead of video title #3901
* fix #3901
* assign title directly #3901
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index e6d614c47..1d335805b 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -98,6 +98,7 @@ export interface CommonOptions extends CustomizationOptions { | |||
98 | 98 | ||
99 | videoViewUrl: string | 99 | videoViewUrl: string |
100 | embedUrl: string | 100 | embedUrl: string |
101 | embedTitle: string | ||
101 | 102 | ||
102 | isLive: boolean | 103 | isLive: boolean |
103 | 104 | ||
@@ -165,7 +166,7 @@ export class PeertubePlayerManager { | |||
165 | PeertubePlayerManager.alreadyPlayed = true | 166 | PeertubePlayerManager.alreadyPlayed = true |
166 | }) | 167 | }) |
167 | 168 | ||
168 | self.addContextMenu(mode, player, options.common.embedUrl) | 169 | self.addContextMenu(mode, player, options.common.embedUrl, options.common.embedTitle) |
169 | 170 | ||
170 | player.bezels() | 171 | player.bezels() |
171 | 172 | ||
@@ -203,7 +204,7 @@ export class PeertubePlayerManager { | |||
203 | videojs(newVideoElement, videojsOptions, function (this: videojs.Player) { | 204 | videojs(newVideoElement, videojsOptions, function (this: videojs.Player) { |
204 | const player = this | 205 | const player = this |
205 | 206 | ||
206 | self.addContextMenu(mode, player, options.common.embedUrl) | 207 | self.addContextMenu(mode, player, options.common.embedUrl, options.common.embedTitle) |
207 | 208 | ||
208 | PeertubePlayerManager.onPlayerChange(player) | 209 | PeertubePlayerManager.onPlayerChange(player) |
209 | }) | 210 | }) |
@@ -492,7 +493,7 @@ export class PeertubePlayerManager { | |||
492 | return children | 493 | return children |
493 | } | 494 | } |
494 | 495 | ||
495 | private static addContextMenu (mode: PlayerMode, player: videojs.Player, videoEmbedUrl: string) { | 496 | private static addContextMenu (mode: PlayerMode, player: videojs.Player, videoEmbedUrl: string, videoEmbedTitle: string) { |
496 | const content = [ | 497 | const content = [ |
497 | { | 498 | { |
498 | label: player.localize('Copy the video URL'), | 499 | label: player.localize('Copy the video URL'), |
@@ -509,7 +510,7 @@ export class PeertubePlayerManager { | |||
509 | { | 510 | { |
510 | label: player.localize('Copy embed code'), | 511 | label: player.localize('Copy embed code'), |
511 | listener: () => { | 512 | listener: () => { |
512 | copyToClipboard(buildVideoOrPlaylistEmbed(videoEmbedUrl)) | 513 | copyToClipboard(buildVideoOrPlaylistEmbed(videoEmbedUrl, videoEmbedTitle)) |
513 | } | 514 | } |
514 | } | 515 | } |
515 | ] | 516 | ] |