import { VideoFile } from '@shared/models'
+import { escapeHTML } from '@shared/core-utils/renderer'
function toTitleCase (str: string) {
return str.charAt(0).toUpperCase() + str.slice(1)
const url = baseUrl
? baseUrl
- : window.location.origin + window.location.pathname.replace('/embed/', '/watch/')
+ : window.location.origin + window.location.pathname.replace('/embed/', '/w/')
const params = generateParams(window.location.search)
function buildPlaylistLink (options: {
baseUrl?: string
- playlistPosition: number
+ playlistPosition?: number
}) {
const { baseUrl } = options
const url = baseUrl
? baseUrl
- : window.location.origin + window.location.pathname.replace('/video-playlists/embed/', '/videos/watch/playlist/')
+ : window.location.origin + window.location.pathname.replace('/video-playlists/embed/', '/w/p/')
const params = generateParams(window.location.search)
return time
}
-function buildVideoOrPlaylistEmbed (embedUrl: string) {
+function buildVideoOrPlaylistEmbed (embedUrl: string, embedTitle: string) {
+ const title = escapeHTML(embedTitle)
return '<iframe width="560" height="315" ' +
'sandbox="allow-same-origin allow-scripts allow-popups" ' +
+ 'title="' + title + '" ' +
'src="' + embedUrl + '" ' +
'frameborder="0" allowfullscreen>' +
'</iframe>'