diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-08 16:26:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-08 16:36:08 +0100 |
commit | 01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09 (patch) | |
tree | b7096d36dbf9607ae1977685e3088a340902a3f8 /client/src/standalone | |
parent | 383386d8e25b5734f8b7ea7277c1a1a118cc488a (diff) | |
download | PeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.tar.gz PeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.tar.zst PeerTube-01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09.zip |
Display avatar in embed poster
Diffstat (limited to 'client/src/standalone')
-rw-r--r-- | client/src/standalone/videos/embed.scss | 1 | ||||
-rw-r--r-- | client/src/standalone/videos/embed.ts | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/client/src/standalone/videos/embed.scss b/client/src/standalone/videos/embed.scss index c2ee16ae2..91ab822c8 100644 --- a/client/src/standalone/videos/embed.scss +++ b/client/src/standalone/videos/embed.scss | |||
@@ -1,7 +1,6 @@ | |||
1 | @use '_variables' as *; | 1 | @use '_variables' as *; |
2 | @use '_mixins' as *; | 2 | @use '_mixins' as *; |
3 | @use 'video.js/dist/video-js'; | 3 | @use 'video.js/dist/video-js'; |
4 | @use 'videojs-dock/dist/videojs-dock'; | ||
5 | 4 | ||
6 | $assets-path: '../../assets/'; | 5 | $assets-path: '../../assets/'; |
7 | @use '../../sass/player/index'; | 6 | @use '../../sass/player/index'; |
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 @@ | |||
1 | import './embed.scss' | 1 | import './embed.scss' |
2 | import '../../assets/player/dock/peertube-dock-component' | ||
3 | import '../../assets/player/dock/peertube-dock-plugin' | ||
2 | import videojs from 'video.js' | 4 | import videojs from 'video.js' |
3 | import { peertubeTranslate } from '../../../../shared/core-utils/i18n' | 5 | import { peertubeTranslate } from '../../../../shared/core-utils/i18n' |
4 | import { | 6 | import { |
@@ -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 | } |