Skip to content

Commit

Permalink
edit: ctrl+left/right to seek +-5s
Browse files Browse the repository at this point in the history
  • Loading branch information
hyww committed May 21, 2017
1 parent 5d1e2c2 commit ce8db31
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class App extends Component {
onKeyDown={this.onTextKeyDown}
value={this.state.text}
ref="text"
title="Ctrl+[ to insert timestamp"
></textarea>
</div>
</div>
Expand Down Expand Up @@ -270,6 +271,22 @@ class App extends Component {
e.preventDefault();
}
break;
case 39://right
if(e.ctrlKey) {
const time = this.state.time+5;
this.state.player.seekTo(time, true);
this.setState({ time });
e.preventDefault();
}
break;
case 37://left
if(e.ctrlKey) {
const time = this.state.time-5;
this.state.player.seekTo(time, true);
this.setState({ time });
e.preventDefault();
}
break;
default:
}
}
Expand Down

0 comments on commit ce8db31

Please sign in to comment.