+ res.status(HttpStatusCode.NOT_FOUND_404)
+ return html
+ }
+ const description = mdToOneLinePlainText(video.description)
+
+ let customHtml = ClientHtml.addTitleTag(html, video.name)
+ customHtml = ClientHtml.addDescriptionTag(customHtml, description)
+
+ const url = WEBSERVER.URL + video.getWatchStaticPath()
+ const originUrl = video.url
+ const title = video.name
+ const siteName = CONFIG.INSTANCE.NAME
+
+ const image = {
+ url: WEBSERVER.URL + video.getPreviewStaticPath()
+ }
+
+ const embed = {
+ url: WEBSERVER.URL + video.getEmbedStaticPath(),
+ createdAt: video.createdAt.toISOString(),
+ duration: getActivityStreamDuration(video.duration),
+ views: video.views
+ }
+
+ const ogType = 'video'
+ const twitterCard = CONFIG.SERVICES.TWITTER.WHITELISTED ? 'player' : 'summary_large_image'
+ const schemaType = 'VideoObject'
+
+ customHtml = ClientHtml.addTags(customHtml, {
+ url,
+ originUrl,
+ escapedSiteName: escapeHTML(siteName),
+ escapedTitle: escapeHTML(title),
+ escapedDescription: escapeHTML(description),
+ disallowIndexation: video.privacy !== VideoPrivacy.PUBLIC,
+ image,
+ embed,
+ ogType,
+ twitterCard,
+ schemaType
+ })
+
+ return customHtml
+ }
+
+ static async getWatchPlaylistHTMLPage (videoPlaylistIdArg: string, req: express.Request, res: express.Response) {
+ const videoPlaylistId = toCompleteUUID(videoPlaylistIdArg)
+
+ // Let Angular application handle errors
+ if (!validator.isInt(videoPlaylistId) && !validator.isUUID(videoPlaylistId, 4)) {
+ res.status(HttpStatusCode.NOT_FOUND_404)
+ return ClientHtml.getIndexHTML(req, res)
+ }
+
+ const [ html, videoPlaylist ] = await Promise.all([
+ ClientHtml.getIndexHTML(req, res),
+ VideoPlaylistModel.loadWithAccountAndChannel(videoPlaylistId, null)
+ ])
+
+ // Let Angular application handle errors
+ if (!videoPlaylist || videoPlaylist.privacy === VideoPlaylistPrivacy.PRIVATE) {
+ res.status(HttpStatusCode.NOT_FOUND_404)