Skip to content

Commit

Permalink
Add fullscreen example to demo
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Nov 19, 2016
1 parent 83e8e60 commit 563252b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"react-dom": "^15.3.2",
"rimraf": "^2.5.4",
"sass-loader": "^4.0.2",
"screenfull": "^3.0.2",
"snazzy": "^5.0.0",
"standard": "^8.3.0",
"style-loader": "^0.13.1",
Expand Down
6 changes: 6 additions & 0 deletions src/demo/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Component } from 'react'
import { findDOMNode } from 'react-dom'
import screenfull from 'screenfull'

import 'normalize.css/normalize.css'
import './defaults.scss'
Expand Down Expand Up @@ -50,6 +52,9 @@ export default class App extends Component {
this.setState(state)
}
}
onClickFullscreen = () => {
screenfull.request(findDOMNode(this.player))
}
onConfigSubmit = () => {
let config
try {
Expand Down Expand Up @@ -111,6 +116,7 @@ export default class App extends Component {
<td>
<button onClick={this.stop}>Stop</button>
<button onClick={this.playPause}>{playing ? 'Pause' : 'Play'}</button>
<button onClick={this.onClickFullscreen}>Fullscreen</button>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 563252b

Please sign in to comment.