aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-10 16:47:25 +0100
committerChocobozzz <me@florianbigard.com>2020-11-10 16:47:25 +0100
commitb9da21bd5a3ad00f44997930391e3316182a07db (patch)
tree7c56d4c2ad2956568b1b0c6622a18636aa9963e8
parent2af337c83905c420b2d9022ee6fd3d6ef5fd1e42 (diff)
downloadPeerTube-b9da21bd5a3ad00f44997930391e3316182a07db.tar.gz
PeerTube-b9da21bd5a3ad00f44997930391e3316182a07db.tar.zst
PeerTube-b9da21bd5a3ad00f44997930391e3316182a07db.zip
Hide dock if there are no title/description
-rw-r--r--client/src/standalone/videos/embed.ts14
-rw-r--r--server/lib/client-html.ts6
2 files changed, 11 insertions, 9 deletions
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 66033158b..115d37ced 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -558,9 +558,9 @@ export class PeerTubeEmbed {
558 558
559 Object.assign(options, { 559 Object.assign(options, {
560 p2pMediaLoader: { 560 p2pMediaLoader: {
561 playlistUrl: 'http://localhost:9000/live/toto/master.m3u8', 561 playlistUrl: hlsPlaylist.playlistUrl,
562 segmentsSha256Url: hlsPlaylist.segmentsSha256Url, 562 segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
563 redundancyBaseUrls: [], 563 redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
564 trackerAnnounce: videoInfo.trackerUrls, 564 trackerAnnounce: videoInfo.trackerUrls,
565 videoFiles: hlsPlaylist.files 565 videoFiles: hlsPlaylist.files
566 } as P2PMediaLoaderOptions 566 } as P2PMediaLoaderOptions
@@ -663,10 +663,12 @@ export class PeerTubeEmbed {
663 ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>' 663 ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
664 : undefined 664 : undefined
665 665
666 this.player.dock({ 666 if (title || description) {
667 title, 667 this.player.dock({
668 description 668 title,
669 }) 669 description
670 })
671 }
670 } 672 }
671 673
672 private buildCSS () { 674 private buildCSS () {
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index b8c87e957..7d1d19588 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -9,7 +9,7 @@ import {
9 FILES_CONTENT_HASH 9 FILES_CONTENT_HASH
10} from '../initializers/constants' 10} from '../initializers/constants'
11import { join } from 'path' 11import { join } from 'path'
12import { escapeHTML, sha256 } from '../helpers/core-utils' 12import { escapeHTML, isTestInstance, sha256 } from '../helpers/core-utils'
13import { VideoModel } from '../models/video/video' 13import { VideoModel } from '../models/video/video'
14import { VideoPlaylistModel } from '../models/video/video-playlist' 14import { VideoPlaylistModel } from '../models/video/video-playlist'
15import validator from 'validator' 15import validator from 'validator'
@@ -177,7 +177,7 @@ export class ClientHtml {
177 static async getEmbedHTML () { 177 static async getEmbedHTML () {
178 const path = ClientHtml.getEmbedPath() 178 const path = ClientHtml.getEmbedPath()
179 179
180 if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] 180 if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path]
181 181
182 const buffer = await readFile(path) 182 const buffer = await readFile(path)
183 183
@@ -230,7 +230,7 @@ export class ClientHtml {
230 230
231 private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) { 231 private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) {
232 const path = ClientHtml.getIndexPath(req, res, paramLang) 232 const path = ClientHtml.getIndexPath(req, res, paramLang)
233 if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] 233 if (!isTestInstance() && ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path]
234 234
235 const buffer = await readFile(path) 235 const buffer = await readFile(path)
236 236