mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
76 lines
1.5 KiB
TypeScript
76 lines
1.5 KiB
TypeScript
import type { ResolvedOption } from './types'
|
|
import { isSafari } from '../utils/compatibility'
|
|
|
|
export default function createDefaults(): ResolvedOption {
|
|
return {
|
|
id: '',
|
|
container: '#artplayer',
|
|
url: '',
|
|
poster: '',
|
|
type: '',
|
|
theme: '#f00',
|
|
volume: 0.7,
|
|
isLive: false,
|
|
muted: false,
|
|
autoplay: false,
|
|
autoSize: false,
|
|
autoMini: false,
|
|
loop: false,
|
|
flip: false,
|
|
playbackRate: false,
|
|
aspectRatio: false,
|
|
screenshot: false,
|
|
setting: false,
|
|
hotkey: true,
|
|
pip: false,
|
|
mutex: true,
|
|
backdrop: true,
|
|
fullscreen: false,
|
|
fullscreenWeb: false,
|
|
subtitleOffset: false,
|
|
miniProgressBar: false,
|
|
useSSR: false,
|
|
playsInline: true,
|
|
lock: false,
|
|
gesture: true,
|
|
fastForward: false,
|
|
autoPlayback: false,
|
|
autoOrientation: false,
|
|
airplay: false,
|
|
proxy: undefined,
|
|
layers: [],
|
|
contextmenu: [],
|
|
controls: [],
|
|
settings: [],
|
|
quality: [],
|
|
highlight: [],
|
|
plugins: [],
|
|
thumbnails: {
|
|
url: '',
|
|
number: 60,
|
|
column: 10,
|
|
width: 0,
|
|
height: 0,
|
|
scale: 1,
|
|
},
|
|
subtitle: {
|
|
url: '',
|
|
type: '',
|
|
style: {},
|
|
name: '',
|
|
escape: true,
|
|
encoding: 'utf-8',
|
|
onVttLoad: vtt => vtt,
|
|
},
|
|
moreVideoAttr: {
|
|
controls: false,
|
|
preload: isSafari ? 'auto' : 'metadata',
|
|
},
|
|
i18n: {},
|
|
icons: {},
|
|
cssVar: {},
|
|
customType: {},
|
|
lang: navigator?.language.toLowerCase(),
|
|
}
|
|
}
|