Hide dock if there are no title/description

This commit is contained in:
Chocobozzz 2020-11-10 16:47:25 +01:00
parent 2af337c839
commit b9da21bd5a
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 11 additions and 9 deletions

View File

@ -558,9 +558,9 @@ export class PeerTubeEmbed {
Object.assign(options, { Object.assign(options, {
p2pMediaLoader: { p2pMediaLoader: {
playlistUrl: 'http://localhost:9000/live/toto/master.m3u8', playlistUrl: hlsPlaylist.playlistUrl,
segmentsSha256Url: hlsPlaylist.segmentsSha256Url, segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
redundancyBaseUrls: [], redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
trackerAnnounce: videoInfo.trackerUrls, trackerAnnounce: videoInfo.trackerUrls,
videoFiles: hlsPlaylist.files videoFiles: hlsPlaylist.files
} as P2PMediaLoaderOptions } as P2PMediaLoaderOptions
@ -663,10 +663,12 @@ export class PeerTubeEmbed {
? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>' ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
: undefined : undefined
this.player.dock({ if (title || description) {
title, this.player.dock({
description title,
}) description
})
}
} }
private buildCSS () { private buildCSS () {

View File

@ -9,7 +9,7 @@ import {
FILES_CONTENT_HASH FILES_CONTENT_HASH
} from '../initializers/constants' } from '../initializers/constants'
import { join } from 'path' import { join } from 'path'
import { escapeHTML, sha256 } from '../helpers/core-utils' import { escapeHTML, isTestInstance, sha256 } from '../helpers/core-utils'
import { VideoModel } from '../models/video/video' import { VideoModel } from '../models/video/video'
import { VideoPlaylistModel } from '../models/video/video-playlist' import { VideoPlaylistModel } from '../models/video/video-playlist'
import validator from 'validator' import validator from 'validator'
@ -177,7 +177,7 @@ export class ClientHtml {
static async getEmbedHTML () { static async getEmbedHTML () {
const path = ClientHtml.getEmbedPath() const path = ClientHtml.getEmbedPath()
if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path]
const buffer = await readFile(path) const buffer = await readFile(path)
@ -230,7 +230,7 @@ export class ClientHtml {
private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) { private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) {
const path = ClientHtml.getIndexPath(req, res, paramLang) const path = ClientHtml.getIndexPath(req, res, paramLang)
if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path]
const buffer = await readFile(path) const buffer = await readFile(path)