+
+ const url = WEBSERVER.URL + video.getWatchStaticPath()
+ const title = escapeHTML(video.name)
+ const siteName = escapeHTML(CONFIG.INSTANCE.NAME)
+ const description = escapeHTML(video.description)
+
+ 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, siteName, title, description, image, embed, ogType, twitterCard, schemaType })
+
+ return customHtml
+ }
+
+ static async getWatchPlaylistHTMLPage (videoPlaylistId: string, req: express.Request, res: express.Response) {
+ // 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)
+ return html
+ }
+
+ let customHtml = ClientHtml.addTitleTag(html, escapeHTML(videoPlaylist.name))
+ customHtml = ClientHtml.addDescriptionTag(customHtml, escapeHTML(videoPlaylist.description))
+
+ const url = videoPlaylist.getWatchUrl()
+ const title = escapeHTML(videoPlaylist.name)
+ const siteName = escapeHTML(CONFIG.INSTANCE.NAME)
+ const description = escapeHTML(videoPlaylist.description)
+
+ const image = {
+ url: videoPlaylist.getThumbnailUrl()
+ }
+
+ const embed = {
+ url: WEBSERVER.URL + videoPlaylist.getEmbedStaticPath(),
+ createdAt: videoPlaylist.createdAt.toISOString()
+ }
+
+ const list = {
+ numberOfItems: videoPlaylist.get('videosLength') as number
+ }
+
+ const ogType = 'video'
+ const twitterCard = CONFIG.SERVICES.TWITTER.WHITELISTED ? 'player' : 'summary'
+ const schemaType = 'ItemList'
+
+ customHtml = ClientHtml.addTags(customHtml, { url, siteName, embed, title, description, image, list, ogType, twitterCard, schemaType })