Skip to content

Commit

Permalink
Pass controls prop through to preload players
Browse files Browse the repository at this point in the history
Fixes #587
  • Loading branch information
cookpete committed Mar 24, 2019
1 parent 80e4680 commit 25a946f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export default class ReactPlayer extends Component {
return 0
}
render () {
const { url, style, width, height, light, wrapper: Wrapper } = this.props
const { url, controls, style, width, height, light, wrapper: Wrapper } = this.props
const { showPreview } = this.state
const otherProps = omit(this.props, SUPPORTED_PROPS, DEPRECATED_CONFIG_PROPS)
const activePlayer = this.getActivePlayer(url)
const renderedActivePlayer = this.renderActivePlayer(url, activePlayer)
const preloadPlayers = renderPreloadPlayers(url, this.config)
const preloadPlayers = renderPreloadPlayers(url, controls, this.config)
const players = [ renderedActivePlayer, ...preloadPlayers ].sort(this.sortPlayers)
if (showPreview && url) {
return (
Expand Down
3 changes: 2 additions & 1 deletion src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PRELOAD_PLAYERS = [
}
]

export default function renderPreloadPlayers (url, config) {
export default function renderPreloadPlayers (url, controls, config) {
const players = []

for (let player of PRELOAD_PLAYERS) {
Expand All @@ -39,6 +39,7 @@ export default function renderPreloadPlayers (url, config) {
key={player.Player.displayName}
activePlayer={player.Player}
url={player.url}
controls={controls}
playing
muted
style={{ display: 'none' }}
Expand Down

0 comments on commit 25a946f

Please sign in to comment.