mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 20:26:16 -08:00
34 lines
582 B
TypeScript
34 lines
582 B
TypeScript
import type Artplayer from 'artplayer'
|
|
import type { Option } from 'artplayer'
|
|
import Player from './Player'
|
|
|
|
function getInstance(art: Artplayer) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(art)
|
|
}
|
|
|
|
const style = {
|
|
width: '800px',
|
|
height: '600px',
|
|
margin: '60px auto 0',
|
|
}
|
|
|
|
const option: Partial<Option> = {
|
|
url: 'https://artplayer.org/assets/sample/video.mp4',
|
|
autoSize: true,
|
|
}
|
|
|
|
function App() {
|
|
return (
|
|
<div>
|
|
<Player
|
|
style={style}
|
|
option={option}
|
|
getInstance={getInstance}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default App
|