瀏覽代碼

video poster

qinyan 1 年之前
父節點
當前提交
398fb6ba1f

+ 1 - 0
src/modules/editor/components/CompUI/basicUI/Video/component.tsx

@@ -41,6 +41,7 @@ export const Component = defineComponent({
       if (value.autoplay) options.autoplay = true;
       if (value.loop) options.loop = true;
       if (value.controls) options.controls = true;
+      if (value.poster) options.poster = value.poster;
 
       return (
         <View class={rootCls} compId={props.compId}>

+ 7 - 0
src/modules/editor/components/CompUI/basicUI/Video/index.ts

@@ -1,5 +1,6 @@
 import { createAttrsForm } from "../../defines/createAttrsForm";
 import { createCompHooks } from "../../defines/createCompHooks";
+import { ImagePicker } from "../../formItems/ImagePicker";
 
 export { Component } from "./component";
 
@@ -15,6 +16,7 @@ export const { createComp, useCompData } = createCompHooks({
     autoplay: true,
     loop: true,
     controls: true,
+    poster: "",
   },
   layout: {
     size: [750, 750],
@@ -27,6 +29,11 @@ export const Form = createAttrsForm([
   //   dataIndex: "value.url",
   //   component: "Input",
   // },
+  {
+    label: "封面",
+    dataIndex: "value.poster",
+    component: ImagePicker,
+  },
   {
     label: "视频比例",
     dataIndex: "value.ratio",