Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Hide dock if there are no title/description

Chocobozzzb9da21bd5a3a
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 66033158b6..115d37ced9 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -558,9 +558,9 @@ export class PeerTubeEmbed {
Object.assign(options, {
p2pMediaLoader: {
- playlistUrl: 'http://localhost:9000/live/toto/master.m3u8',
+ playlistUrl: hlsPlaylist.playlistUrl,
segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
- redundancyBaseUrls: [],
+ redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
trackerAnnounce: videoInfo.trackerUrls,
videoFiles: hlsPlaylist.files
} as P2PMediaLoaderOptions
@@ -663,10 +663,12 @@ export class PeerTubeEmbed {
? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
: undefined
- this.player.dock({
- title,
- description
- })
+ if (title || description) {
+ this.player.dock({
+ title,
+ description
+ })
+ }
}
private buildCSS () {
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index b8c87e9578..7d1d195888 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -9,7 +9,7 @@ import {
FILES_CONTENT_HASH
} from '../initializers/constants'
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 { VideoPlaylistModel } from '../models/video/video-playlist'
import validator from 'validator'
@@ -177,7 +177,7 @@ export class ClientHtml {
static async getEmbedHTML () {
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)
@@ -230,7 +230,7 @@ export class ClientHtml {
private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) {
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)