config.ts 778 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
  2. /** 视频播放属性 */
  3. export interface VideoPlayerProperty {
  4. // 视频链接
  5. videoUrl: string
  6. // 封面链接
  7. posterUrl: string
  8. // 是否自动播放
  9. autoplay: boolean
  10. // 组件样式
  11. style: VideoPlayerStyle
  12. }
  13. // 视频播放样式
  14. export interface VideoPlayerStyle extends ComponentStyle {
  15. // 视频高度
  16. height: number
  17. }
  18. // 定义组件
  19. export const component = {
  20. id: 'VideoPlayer',
  21. name: '视频播放',
  22. icon: 'ep:video-play',
  23. property: {
  24. videoUrl: '',
  25. posterUrl: '',
  26. autoplay: false,
  27. style: {
  28. bgType: 'color',
  29. bgColor: '#fff',
  30. marginBottom: 8,
  31. height: 300
  32. } as ComponentStyle
  33. }
  34. } as DiyComponent<VideoPlayerProperty>