index.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { createAttrsForm } from "../../defines/createAttrsForm";
  2. import { createCompHooks } from "../../defines/createCompHooks";
  3. import { ImagePicker } from "../../formItems/ImagePicker";
  4. export { Component } from "./component";
  5. export const options = {
  6. name: "视频",
  7. thumbnail: require("@/modules/editor/assets/icons/video2.svg"),
  8. };
  9. export const { createComp, useCompData } = createCompHooks({
  10. value: {
  11. url: "//infishwaibao.oss-cn-chengdu.aliyuncs.com/release/sku3d/media/shoes.1c5c29ad.webm",
  12. ratio: 1,
  13. autoplay: true,
  14. loop: true,
  15. controls: true,
  16. poster: "",
  17. },
  18. layout: {
  19. size: [750, 750],
  20. },
  21. });
  22. export const Form = createAttrsForm([
  23. // {
  24. // label: "视频地址",
  25. // dataIndex: "value.url",
  26. // component: "Input",
  27. // },
  28. {
  29. label: "封面",
  30. dataIndex: "value.poster",
  31. component: ImagePicker,
  32. },
  33. {
  34. label: "视频比例",
  35. dataIndex: "value.ratio",
  36. component: "Select",
  37. props: {
  38. options: [
  39. { label: "原始比例", value: 0 },
  40. { label: "1:1", value: 1 },
  41. { label: "4:3", value: 4 / 3 },
  42. { label: "3:4", value: 3 / 4 },
  43. { label: "16:9", value: 16 / 9 },
  44. { label: "9:16", value: 9 / 16 },
  45. ],
  46. },
  47. },
  48. // {
  49. // label: "自动播放",
  50. // dataIndex: "value.autoplay",
  51. // component: "Switch",
  52. // },
  53. {
  54. label: "循环播放",
  55. dataIndex: "value.loop",
  56. component: "Switch",
  57. },
  58. // {
  59. // label: "显示控制器",
  60. // dataIndex: "value.controls",
  61. // component: "Switch",
  62. // },
  63. ]);