aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/embed.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-08 16:26:30 +0100
committerChocobozzz <me@florianbigard.com>2022-03-08 16:36:08 +0100
commit01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09 (patch)
treeb7096d36dbf9607ae1977685e3088a340902a3f8 /client/src/standalone/videos/embed.ts
parent383386d8e25b5734f8b7ea7277c1a1a118cc488a (diff)
downloadPeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.tar.gz
PeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.tar.zst
PeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.zip
Display avatar in embed poster
Diffstat (limited to 'client/src/standalone/videos/embed.ts')
-rw-r--r--client/src/standalone/videos/embed.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 054f771ab..38ff39890 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -1,4 +1,6 @@
1import './embed.scss' 1import './embed.scss'
2import '../../assets/player/dock/peertube-dock-component'
3import '../../assets/player/dock/peertube-dock-plugin'
2import videojs from 'video.js' 4import videojs from 'video.js'
3import { peertubeTranslate } from '../../../../shared/core-utils/i18n' 5import { peertubeTranslate } from '../../../../shared/core-utils/i18n'
4import { 6import {
@@ -678,15 +680,22 @@ export class PeerTubeEmbed {
678 if (!this.player.player_) return 680 if (!this.player.player_) return
679 681
680 const title = this.title ? videoInfo.name : undefined 682 const title = this.title ? videoInfo.name : undefined
681
682 const description = this.warningTitle && this.p2pEnabled 683 const description = this.warningTitle && this.p2pEnabled
683 ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>' 684 ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
684 : undefined 685 : undefined
685 686
687 const availableAvatars = videoInfo.channel.avatars.filter(a => a.width < 50)
688 const avatar = availableAvatars.length !== 0
689 ? availableAvatars[0]
690 : undefined
691
686 if (title || description) { 692 if (title || description) {
687 this.player.dock({ 693 this.player.peertubeDock({
688 title, 694 title,
689 description 695 description,
696 avatarUrl: title && avatar
697 ? avatar.path
698 : undefined
690 }) 699 })
691 } 700 }
692 } 701 }