// @ts-ignore
import React, { useRef, useEffect } from 'react';
import Video from '../index';

const Demo1 = (props) => {
  const jessibuca = useRef(null);

  let JessibucaObj = {
    operateBtns: {
      // fullscreen: false,
      screenshot: false,
    },
    loadingText: '演示视频加载中',
  };

  let VideoInfo = {
    key: '/live/s8',
    fullUrl: 'http://flv.bdplay.nodemedia.cn/live/bbb.flv',
    useFullUrl: false,
    cameraName: `摄像头s8`,
  };

  useEffect(() => {
    console.log(jessibuca);
  }, []);

  const stopVideo = () => {
    jessibuca.current.pause();
  };

  const startVideo = () => {
    jessibuca.current.play();
  };
  return (
    <div>
      <button onClick={stopVideo}>暂停</button>
      <button onClick={startVideo}>开始</button>
      <Video {...{ JessibucaObj: JessibucaObj, VideoInfo: VideoInfo }} ref={jessibuca} />
    </div>
  );
};

export default Demo1;
