Commit 5f277be5e24fe6af7ed5d55664b7a9006c4dd028

Authored by fengwotao
1 parent cc18732c

feat(packages/external): 单个摄像头新增播放配置

@@ -26,6 +26,10 @@ const props = defineProps({ @@ -26,6 +26,10 @@ const props = defineProps({
26 }, 26 },
27 index: { 27 index: {
28 type: Number 28 type: Number
  29 + },
  30 + autoplay: {
  31 + type: Boolean,
  32 + default: false
29 } 33 }
30 }) 34 })
31 35
@@ -40,7 +44,7 @@ const options: VideoJsPlayerOptions = { @@ -40,7 +44,7 @@ const options: VideoJsPlayerOptions = {
40 language: 'zh-CN', // 设置语言 44 language: 'zh-CN', // 设置语言
41 controls: true, // 是否显示控制条 45 controls: true, // 是否显示控制条
42 preload: 'auto', // 预加载 46 preload: 'auto', // 预加载
43 - autoplay: true, // 是否自动播放 47 + autoplay: props.autoplay, // 是否自动播放
44 fluid: false, // 自适应宽高 48 fluid: false, // 自适应宽高
45 poster: props?.avatar || '', 49 poster: props?.avatar || '',
46 src: props?.sourceSrc || '', // 要嵌入的视频源的源 URL 50 src: props?.sourceSrc || '', // 要嵌入的视频源的源 URL
@@ -9,11 +9,7 @@ export const option = { @@ -9,11 +9,7 @@ export const option = {
9 url: '' 9 url: ''
10 } 10 }
11 ] as any, 11 ] as any,
12 - // 自动播放的间隔(ms)  
13 - interval: 5000,  
14 - autoplay: true,  
15 - effect: 'slide',  
16 - displayMode: 'singleGrid' 12 + autoplay: false,
17 } 13 }
18 14
19 export default class Config extends PublicConfigClass implements CreateComponentType { 15 export default class Config extends PublicConfigClass implements CreateComponentType {
@@ -7,6 +7,11 @@ @@ -7,6 +7,11 @@
7 </n-input-group> 7 </n-input-group>
8 </setting-item> 8 </setting-item>
9 </setting-item-box> 9 </setting-item-box>
  10 + <setting-item-box name="自动播放">
  11 + <setting-item>
  12 + <n-switch v-model:value="optionData.autoplay" size="small" />
  13 + </setting-item>
  14 + </setting-item-box>
10 </CollapseItem> 15 </CollapseItem>
11 </template> 16 </template>
12 17
@@ -21,5 +26,4 @@ defineProps({ @@ -21,5 +26,4 @@ defineProps({
21 required: true 26 required: true
22 } 27 }
23 }) 28 })
24 -  
25 </script> 29 </script>
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 :key="item + index" 10 :key="item + index"
11 :sourceSrc="item.url" 11 :sourceSrc="item.url"
12 :index="index" 12 :index="index"
  13 + :autoplay="autoplay"
13 /> 14 />
14 </div> 15 </div>
15 </n-gi> 16 </n-gi>
@@ -32,6 +33,8 @@ const props = defineProps({ @@ -32,6 +33,8 @@ const props = defineProps({
32 33
33 const { h } = toRefs(props.chartConfig.attr) 34 const { h } = toRefs(props.chartConfig.attr)
34 35
  36 +const { autoplay } = toRefs(props.chartConfig.option)
  37 +
35 const responsiveComputeValue = ref(0) 38 const responsiveComputeValue = ref(0)
36 39
37 const option = shallowReactive({ 40 const option = shallowReactive({