File tree 1 file changed +3
-1
lines changed
packages/player-react/src
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ interface PlayerProps {
44
44
onTimeUpdate ?: ( currentTime : number ) => void ;
45
45
onPlayerReady ?: ( player : CorePlayer ) => void ;
46
46
onPlayerResize ?: ( rect : DOMRectReadOnly ) => void ;
47
+ onClick ?: ( ) => void ;
47
48
}
48
49
49
50
export function Player ( {
@@ -65,6 +66,7 @@ export function Player({
65
66
onTimeUpdate = ( ) => { } ,
66
67
onPlayerReady = ( ) => { } ,
67
68
onPlayerResize = ( ) => { } ,
69
+ onClick,
68
70
} : PlayerProps ) {
69
71
const [ playingState , setPlaying ] = useState ( playing ) ;
70
72
const [ isMouseOver , setIsMouseOver ] = useState ( false ) ;
@@ -77,7 +79,7 @@ export function Player({
77
79
const wrapperRef = useRef < HTMLDivElement | null > ( null ) ;
78
80
const lastRect = useRef < DOMRectReadOnly | null > ( null ) ;
79
81
80
- const onClickHandler = controls ? ( ) => setPlaying ( prev => ! prev ) : undefined ;
82
+ const onClickHandler = onClick || ( controls ? ( ) => setPlaying ( prev => ! prev ) : undefined ) ;
81
83
82
84
/**
83
85
* Sync the playing prop with the player's own state when it changes.
You can’t perform that action at this time.
0 commit comments