import React, { useState, useEffect } from 'react';
import ReactPlayer from 'react-player';

//样式文件注意要加上
import 'video.js/dist/video-js.css';
import { Modal } from 'antd';
export type FormValueType = {
  target?: string;
  template?: string;
  type?: string;
  time?: string;
  frequency?: string;
} & Partial<API.Device>;

export type VideoModalProps = {
  modalOpen: boolean;
  handleModal: () => void;
  values: Partial<API.Device>;
  reload: any;
  videoServerParam: API.RtspRes;
};

const VideoModal: React.FC<VideoModalProps> = (props) => {

  const videoUrl = 'rtsp://admin:@192.168.10.11';

  return (
    <Modal title="播放视频" open={props.modalOpen}
           width={1280}
           onOk={props.handleModal} onCancel={props.handleModal}
           footer={null}>
            <ReactPlayer
        url={videoUrl}
        controls={true}
        width="100%"
        type ='audio/rtsp'
        height="auto"
      />

    </Modal>
  )
}
export default VideoModal;
