mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Display avatar in embed poster
This commit is contained in:
parent
383386d8e2
commit
01dd04cd5a
9 changed files with 170 additions and 26 deletions
|
@ -1,4 +1,6 @@
|
|||
import './embed.scss'
|
||||
import '../../assets/player/dock/peertube-dock-component'
|
||||
import '../../assets/player/dock/peertube-dock-plugin'
|
||||
import videojs from 'video.js'
|
||||
import { peertubeTranslate } from '../../../../shared/core-utils/i18n'
|
||||
import {
|
||||
|
@ -678,15 +680,22 @@ export class PeerTubeEmbed {
|
|||
if (!this.player.player_) return
|
||||
|
||||
const title = this.title ? videoInfo.name : undefined
|
||||
|
||||
const description = this.warningTitle && this.p2pEnabled
|
||||
? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
|
||||
: undefined
|
||||
|
||||
const availableAvatars = videoInfo.channel.avatars.filter(a => a.width < 50)
|
||||
const avatar = availableAvatars.length !== 0
|
||||
? availableAvatars[0]
|
||||
: undefined
|
||||
|
||||
if (title || description) {
|
||||
this.player.dock({
|
||||
this.player.peertubeDock({
|
||||
title,
|
||||
description
|
||||
description,
|
||||
avatarUrl: title && avatar
|
||||
? avatar.path
|
||||
: undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue