Commit 5f277be5e24fe6af7ed5d55664b7a9006c4dd028

Authored by fengwotao
1 parent cc18732c

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

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