-import { escapeHTML } from '@shared/core-utils/renderer'
import { VideoFile } from '@shared/models'
function toTitleCase (str: string) {
// Detect iPad Desktop mode
return !!(navigator.maxTouchPoints &&
navigator.maxTouchPoints > 2 &&
- /MacIntel/.test(navigator.platform))
+ navigator.platform.includes('MacIntel'))
}
function isSafari () {
}
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>'
+ const iframe = document.createElement('iframe')
+
+ iframe.title = embedTitle
+ iframe.width = '560'
+ iframe.height = '315'
+ iframe.src = embedUrl
+ iframe.frameBorder = '0'
+ iframe.allowFullscreen = true
+ iframe.sandbox.add('allow-same-origin', 'allow-scripts', 'allow-popups')
+
+ return iframe.outerHTML
}
function videoFileMaxByResolution (files: VideoFile[]) {