Skip to content

Commit

Permalink
Fix preload display logic
Browse files Browse the repository at this point in the history
Introduced by #609
Fixes #675
  • Loading branch information
cookpete committed Aug 10, 2019
1 parent 59586ca commit 57d586a
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/players/DailyMotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ export class DailyMotion extends Component {
this.container = container
}
render () {
const { display } = this.props
const style = {
width: '100%',
height: '100%',
backgroundColor: 'black'
backgroundColor: 'black',
display
}
return (
<div style={style}>
Expand Down
4 changes: 3 additions & 1 deletion src/players/SoundCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ export class SoundCloud extends Component {
this.iframe = iframe
}
render () {
const { display } = this.props
const style = {
width: '100%',
height: '100%'
height: '100%',
display
}
return (
<iframe
Expand Down
4 changes: 3 additions & 1 deletion src/players/Vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ export class Vimeo extends Component {
this.container = container
}
render () {
const { display } = this.props
const style = {
width: '100%',
height: '100%',
overflow: 'hidden',
backgroundColor: 'black'
backgroundColor: 'black',
display
}
return (
<div
Expand Down
4 changes: 3 additions & 1 deletion src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ export class YouTube extends Component {
this.container = container
}
render () {
const { display } = this.props
const style = {
width: '100%',
height: '100%'
height: '100%',
display
}
return (
<div style={style}>
Expand Down
2 changes: 1 addition & 1 deletion src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function renderPreloadPlayers (url, controls, config) {
controls={controls}
playing
muted
style={{ display: 'none' }}
display='none'
/>
)
}
Expand Down
2 changes: 1 addition & 1 deletion test/ReactPlayer/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test('preload players', t => {
const props = {
playing: true,
muted: true,
style: { display: 'none' }
display: 'none'
}
t.true(wrapper.children().length === 4)
t.true(wrapper.childAt(0).matchesElement(<Player key='DailyMotion' activePlayer={DailyMotion} {...props} />))
Expand Down
3 changes: 2 additions & 1 deletion test/players/DailyMotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ test('render()', t => {
const style = {
width: '100%',
height: '100%',
backgroundColor: 'black'
backgroundColor: 'black',
display: undefined
}
const wrapper = shallow(<DailyMotion config={TEST_CONFIG} />)
t.true(wrapper.contains(
Expand Down
3 changes: 2 additions & 1 deletion test/players/SoundCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ test('getSecondsLoaded()', t => {
test('render()', t => {
const style = {
width: '100%',
height: '100%'
height: '100%',
display: undefined
}
const wrapper = shallow(<SoundCloud url={TEST_URL} />)
t.true(wrapper.contains(
Expand Down
3 changes: 2 additions & 1 deletion test/players/Vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ test('render()', t => {
width: '100%',
height: '100%',
overflow: 'hidden',
backgroundColor: 'black'
backgroundColor: 'black',
display: undefined
}
t.true(wrapper.contains(
<div key={TEST_URL} style={style} />
Expand Down
2 changes: 1 addition & 1 deletion test/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test('onStateChange() - ready', async t => {

test('render()', t => {
const wrapper = shallow(<YouTube url={TEST_URL} />)
const style = { width: '100%', height: '100%' }
const style = { width: '100%', height: '100%', display: undefined }
t.true(wrapper.contains(
<div style={style}>
<div />
Expand Down

0 comments on commit 57d586a

Please sign in to comment.