use const for space bar key code
This commit is contained in:
parent
2cf9d829b4
commit
6157dbd9fe
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,8 @@ import VideoPlayer from './internal/player';
|
|||
import VideoPlayButton from './internal/play-button';
|
||||
import LoadingScreen from './internal/loading-screen';
|
||||
|
||||
const SPACE_BAR_KEYCODE = 32;
|
||||
|
||||
type Props = {
|
||||
cancelPlay: () => void,
|
||||
fileInfo: {
|
||||
|
@ -71,7 +73,7 @@ class Video extends React.PureComponent<Props> {
|
|||
|
||||
handleKeyDown(event: SyntheticKeyboardEvent<*>) {
|
||||
const { searchBarFocused } = this.props;
|
||||
if (!searchBarFocused && event.keyCode === 32) {
|
||||
if (!searchBarFocused && event.keyCode === SPACE_BAR_KEYCODE) {
|
||||
event.preventDefault(); // prevent page scroll
|
||||
this.playContent();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue