Skip to content

Commit

Permalink
full screen: set video size
Browse files Browse the repository at this point in the history
  • Loading branch information
hyww committed May 17, 2017
1 parent cf8c66c commit a3794a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class App extends Component {
this.setTime = this.setTime.bind(this);
this.setOffset = this.setOffset.bind(this);
this.urlOnSet = this.urlOnSet.bind(this);
this.fullOnClick = this.fullOnClick.bind(this);
this.lrcOnChange = this.lrcOnChange.bind(this);
this.onPlayerStateChange = this.onPlayerStateChange.bind(this);
}
Expand Down Expand Up @@ -61,6 +62,9 @@ class App extends Component {
ref="text"
value={defaultVid.lrc}
></textarea>
<button
onClick={this.fullOnClick}
>Fullscreen</button>
</div>
);
}
Expand Down Expand Up @@ -88,6 +92,9 @@ class App extends Component {
this.setState({videoId});
}
}
fullOnClick() {
this.state.player.setSize(window.document.body.clientWidth, window.document.body.clientHeight);
}
setPlayer(player) {
this.setState({player});
}
Expand Down

0 comments on commit a3794a5

Please sign in to comment.