-import { VideoFile } from '../../../../shared/models/videos'
+import { VideoFile } from '@shared/models'
function toTitleCase (str: string) {
return str.charAt(0).toUpperCase() + str.slice(1)
return !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false
}
+function isIOS () {
+ if (/iPad|iPhone|iPod/.test(navigator.platform)) {
+ return true
+ }
+
+ // Detect iPad Desktop mode
+ return !!(navigator.maxTouchPoints &&
+ navigator.maxTouchPoints > 2 &&
+ /MacIntel/.test(navigator.platform))
+}
+
+function isSafari () {
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
+}
+
// https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts
// Don't import all Angular stuff, just copy the code with shame
const dictionaryBytes: Array<{max: number, type: string}> = [
: window.location.origin + window.location.pathname.replace('/embed/', '/watch/')
const params = new URLSearchParams(window.location.search)
- // Remove this unused parameter when we are on a playlist page
+ // Remove these unused parameters when we are on a playlist page
params.delete('videoId')
+ params.delete('resume')
if (options.startTime) {
const startTimeInt = Math.floor(options.startTime)
videoFileMinByResolution,
copyToClipboard,
isMobile,
- bytes
+ bytes,
+ isIOS,
+ isSafari
}