---
title: 视频
group:
  path: /Business
  title: 基础组件
---

## 视频  


```jsx  
import React, { useState } from 'react';
import { Card } from 'antd';  
import { Video } from '@dndc/pudge-basic';  
import VideoButton from '@dndc/pudge-basic/es/video/editor/form/video-button-template';

const config = {
  name: 'playButtonType',
};
const props = { 
  poster:'https://video-react.js.org/assets/poster.png', 
  src:"https://img.dongfeng-nissan.com.cn/Content/car/altima/highlight_video/tvc21.mp4",
  playButton:true,
  autoPlay:false
};  
const style = {
}; 
const track = {
  ended:'test',
  timer:'dn_web-20210615171509-hsgs-{carseries_id}-{id}|carseries_id=52&id=1'
} 
const node = {
  type: 'Video',
  props,
  track,
  style
};

export default () => {
  const [data, setData] = useState(node);

  const onChangePathValue = ({path, value})=>{
    const props = {...data.props, [path]:value };
    setData({...data,props })
  };

   return (
    <div>
      <Card hoverable title="视频播放按钮模板" >
        <VideoButton node={node} propKey={'props'} config={config} onChangePathValue={onChangePathValue} />
      </Card>

       <Card hoverable title="组件" >
         <Video data={data} propsFlage = {9} />
      </Card>
      <Card hoverable title="组件" >
         <Video data={data} propsFlage = {10} />
      </Card>
    </div>
   );
} 
```  

