Skip to content

Commit

Permalink
Tidy up filePlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed May 21, 2016
1 parent c365921 commit 79c2d5a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class FilePlayer extends Base {
this.player.pause()
}
stop () {
this.player.src = ''
this.player.removeAttribute('src')
}
seekTo (fraction) {
super.seekTo(fraction)
Expand All @@ -53,17 +53,12 @@ export default class FilePlayer extends Base {
}
render () {
const Media = AUDIO_EXTENSIONS.test(this.props.url) ? 'audio' : 'video'
const style = { display: this.props.url ? 'block' : 'none' }
const attributes = this.props.fileConfig.attributes
return (
<Media
ref='player'
style={style}
width='100%'
height='100%'
preload='auto'
{...attributes}
/>
)
const style = {
width: '100%',
height: '100%',
display: this.props.url ? 'block' : 'none'
}
return <Media ref='player' style={style} preload='auto' {...attributes} />
}
}

0 comments on commit 79c2d5a

Please sign in to comment.