}
]
+ const schemaTags = {
+ name: videoNameEscaped,
+ description: videoDescriptionEscaped,
+ duration: video.getActivityStreamDuration(),
+ thumbnailURL: previewUrl,
+ contentURL: videoUrl,
+ embedURL: embedUrl,
+ uploadDate: video.createdAt
+ }
+
let tagsString = ''
Object.keys(openGraphMetaTags).forEach(tagName => {
const tagValue = openGraphMetaTags[tagName]
tagsString += `<link rel="alternate" type="${oembedLinkTag.type}" href="${oembedLinkTag.href}" title="${oembedLinkTag.title}" />`
}
+ tagsString += '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">'
+ tagsString += '<h2>Video: <span itemprop="name">' + schemaTags.name + '</span></h2>'
+
+ Object.keys(schemaTags).forEach(tagName => {
+ const tagValue = schemaTags[tagName]
+ tagsString += `<meta itemprop="${tagName}" content="${tagValue}" />`
+ })
+
+ tagsString += '</div>'
+
return htmlStringPage.replace(OPENGRAPH_AND_OEMBED_COMMENT, tagsString)
}
type: 'Video' as 'Video',
id: this.url,
name: this.name,
- // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration
- duration: 'PT' + this.duration + 'S',
+ duration: this.getActivityStreamDuration(),
uuid: this.uuid,
tag,
category,
return unlinkPromise(torrentPath)
}
+ getActivityStreamDuration () {
+ // https://www.w3.org/TR/activitystreams-vocabulary/#dfn-duration
+ return 'PT' + this.duration + 'S'
+ }
+
private getBaseUrls () {
let baseUrlHttp
let baseUrlWs