import React, { Fragment } from 'react'
import ReactFlvPlayer from './flv-player'

export default ({ src }) => {
  const suf = src.split('.').pop()
  const isFlv = suf === 'flv'
  return (
    <Fragment>
      {
        isFlv ? <ReactFlvPlayer url={src} isMuted={true} /> : <video src={src} controls autoPlay={true} controlsList="nodownload">
          <source type={`video/${suf}`} src={src} />
          您的浏览器不支持 video 标签。
    </video>
      }
    </Fragment>

  )
}