vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 2.81 kB
Source Map (JSON)
{"version":3,"file":"symbol.cjs","sources":["../../../components/video/symbol.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\nexport type VideoPresetControl =\n | 'play'\n | 'play-prev'\n | 'play-next'\n | 'refresh'\n | 'timer'\n | 'playback-rate'\n | 'flip'\n | 'volume'\n | 'pip'\n | 'full-window'\n | 'full-browser'\nexport type VideoShortcutOptions = Partial<Record<VideoPresetControl, string>>\nexport type VideoControlName = VideoPresetControl | (string & {})\nexport type VideoControlConfig = VideoControlName | [VideoControlName, any]\n\nexport interface VideoControlLayout {\n left?: VideoControlConfig[],\n center?: VideoControlConfig[],\n right?: VideoControlConfig[],\n}\n\nexport interface VideoPlaybackRate {\n label?: string,\n value: number,\n}\n\nexport type VideoControlType = 'button' | 'select' | 'panel'\n\nexport interface VideoControlOption {\n value: string | number,\n label?: string,\n selectedLabel?: string,\n disabled?: boolean,\n divided?: boolean,\n title?: string,\n}\n\nexport interface VideoSegment {\n time: number,\n title?: string,\n}\n\n// export interface VideoKernel {\n// play: () => void,\n// pause: () => void,\n// mute: () => void,\n// unmute: () => void,\n// prev: () => void,\n// next: () => void,\n// refresh: () => void | boolean\n// }\n\nexport interface VideoState {\n placeId?: string,\n iconScale: number,\n addShortcut: (key: string, cb: () => void) => () => void,\n}\n\nexport interface VideoSlots {\n poster?: () => any,\n}\n\nconst defaultLayout: Required<VideoControlLayout> = {\n left: ['play-prev', 'play', 'play-next', 'refresh', 'timer'],\n center: [],\n right: ['playback-rate', 'volume', 'flip', 'pip', 'full-window', 'full-browser'],\n}\n\nfor (const key of Object.keys(defaultLayout) as (keyof VideoControlLayout)[]) {\n defaultLayout[key] = Object.freeze(defaultLayout[key]) as any\n}\n\nexport const videoDefaultControlLayout = Object.freeze(defaultLayout)\n\nexport const videoDefaultShortcuts = Object.freeze({\n play: 'Space',\n 'play-prev': 'PageUp',\n 'play-next': 'PageDown',\n refresh: 'R',\n flip: 'C',\n volume: 'M',\n pip: 'P',\n 'full-window': 'G',\n 'full-browser': 'F',\n})\n\nexport const VIDEO_STATE = '__VXP_VIDEO_STATE' as unknown as InjectionKey<VideoState>\n"],"names":["defaultLayout","key","videoDefaultControlLayout","videoDefaultShortcuts","VIDEO_STATE"],"mappings":"gFAiEA,MAAMA,EAA8C,CAClD,KAAM,CAAC,YAAa,OAAQ,YAAa,UAAW,OAAO,EAC3D,OAAQ,CAAC,EACT,MAAO,CAAC,gBAAiB,SAAU,OAAQ,MAAO,cAAe,cAAc,CACjF,EAEA,UAAWC,KAAO,OAAO,KAAKD,CAAa,EACzCA,EAAcC,CAAG,EAAI,OAAO,OAAOD,EAAcC,CAAG,CAAC,EAG1C,MAAAC,EAA4B,OAAO,OAAOF,CAAa,EAEvDG,EAAwB,OAAO,OAAO,CACjD,KAAM,QACN,YAAa,SACb,YAAa,WACb,QAAS,IACT,KAAM,IACN,OAAQ,IACR,IAAK,IACL,cAAe,IACf,eAAgB,GAClB,CAAC,EAEYC,EAAc"}