30 lines
768 B
TypeScript
30 lines
768 B
TypeScript
import React, { useRef, useState } from 'react';
|
|
import { Space, Button, VideoViewRef } from '@zhst/meta'
|
|
import { VIDEO_URL } from './mock'
|
|
import FlvPlayer from '../components/FlvPlayer/newFlvPlayer';
|
|
|
|
export default () => {
|
|
const videoRef = useRef<VideoViewRef>(null)
|
|
const [url] = useState(VIDEO_URL)
|
|
|
|
return (
|
|
<Space direction='vertical'>
|
|
<Space>
|
|
<Button onClick={() => videoRef.current?.play()}>播放</Button>
|
|
</Space>
|
|
<div style={{ width: '800px' }}>
|
|
<FlvPlayer
|
|
ref={videoRef}
|
|
url={url}
|
|
config={{
|
|
enableStashBuffer: true,
|
|
stashInitialSize: 1024 * 700,
|
|
isLive: true,
|
|
hasVideo: true,
|
|
}}
|
|
/>
|
|
</div>
|
|
</Space>
|
|
)
|
|
}
|