@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 3.06 kB
Source Map (JSON)
{"version":3,"file":"symbol.mjs","sources":["../../../components/video/symbol.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\r\n\r\nexport type VideoPresetControl =\r\n | 'play'\r\n | 'play-prev'\r\n | 'play-next'\r\n | 'refresh'\r\n | 'timer'\r\n | 'playback-rate'\r\n | 'flip'\r\n | 'volume'\r\n | 'pip'\r\n | 'full-window'\r\n | 'full-browser'\r\nexport type VideoShortcutOptions = Partial<Record<VideoPresetControl, string>>\r\nexport type VideoControlName = VideoPresetControl | (string & {})\r\nexport type VideoControlConfig = VideoControlName | [VideoControlName, any]\r\n\r\nexport interface VideoControlLayout {\r\n left?: VideoControlConfig[],\r\n center?: VideoControlConfig[],\r\n right?: VideoControlConfig[],\r\n}\r\n\r\nexport interface VideoPlaybackRate {\r\n label?: string,\r\n value: number,\r\n}\r\n\r\nexport type VideoControlType = 'button' | 'select' | 'panel'\r\n\r\nexport interface VideoControlOption {\r\n value: string | number,\r\n label?: string,\r\n selectedLabel?: string,\r\n disabled?: boolean,\r\n divided?: boolean,\r\n title?: string,\r\n}\r\n\r\nexport interface VideoSegment {\r\n time: number,\r\n title?: string,\r\n}\r\n\r\n// export interface VideoKernel {\r\n// play: () => void,\r\n// pause: () => void,\r\n// mute: () => void,\r\n// unmute: () => void,\r\n// prev: () => void,\r\n// next: () => void,\r\n// refresh: () => void | boolean\r\n// }\r\n\r\nexport interface VideoState {\r\n placeId?: string,\r\n iconScale: number,\r\n addShortcut: (key: string, cb: () => void) => () => void,\r\n}\r\n\r\nexport interface VideoSlots {\r\n poster?: () => any,\r\n}\r\n\r\nconst defaultLayout: Required<VideoControlLayout> = {\r\n left: ['play-prev', 'play', 'play-next', 'refresh', 'timer'],\r\n center: [],\r\n right: ['playback-rate', 'volume', 'flip', 'pip', 'full-window', 'full-browser'],\r\n}\r\n\r\nfor (const key of Object.keys(defaultLayout) as (keyof VideoControlLayout)[]) {\r\n defaultLayout[key] = Object.freeze(defaultLayout[key]) as any\r\n}\r\n\r\nexport const videoDefaultControlLayout = Object.freeze(defaultLayout)\r\n\r\nexport const videoDefaultShortcuts = Object.freeze({\r\n play: 'Space',\r\n 'play-prev': 'PageUp',\r\n 'play-next': 'PageDown',\r\n refresh: 'R',\r\n flip: 'C',\r\n volume: 'M',\r\n pip: 'P',\r\n 'full-window': 'G',\r\n 'full-browser': 'F',\r\n})\r\n\r\nexport const VIDEO_STATE = '__VXP_VIDEO_STATE' as unknown as InjectionKey<VideoState>\r\n"],"names":["defaultLayout","key","videoDefaultControlLayout","videoDefaultShortcuts","VIDEO_STATE"],"mappings":"AAiEA,MAAMA,IAA8C;AAAA,EAClD,MAAM,CAAC,aAAa,QAAQ,aAAa,WAAW,OAAO;AAAA,EAC3D,QAAQ,CAAC;AAAA,EACT,OAAO,CAAC,iBAAiB,UAAU,QAAQ,OAAO,eAAe,cAAc;AACjF;AAEA,WAAWC,KAAO,OAAO,KAAKD,CAAa;AACzC,EAAAA,EAAcC,CAAG,IAAI,OAAO,OAAOD,EAAcC,CAAG,CAAC;AAG1C,MAAAC,IAA4B,OAAO,OAAOF,CAAa,GAEvDG,IAAwB,OAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,eAAe;AAAA,EACf,gBAAgB;AAClB,CAAC,GAEYC,IAAc;"}